Well, in the first place, it isn't smaht to show a line number if you don't show enough code for us to count lines, or at least highlight the line as YOU know it. We're not sitting in your chair looking at your screen.

Secondly, the construct, MAT[] = {1,1,2,1,0,0,0,0}; is not a workable runtime operation. It is only good at compile time, when the compiler does you a favor by converting it into an initialization sequence (which becomes a permanent part of the program prior to its conversion to actual executable code).

In C/C++ arrays are not an atomic thing that can be assigned to in one swell foop. They are a collection of individual items that must be treated individually. Your code is NOT ansi C code, despite your claims to the contrary.

Thank you for you quick answer!
But I still have some questions. Defenitly, I have a conceptual problem which is not described in my books.
All what I did is in my C books (or at least that's what I underestand so far..)

What I wanna do is just a switch or if loop wich -according with a variable I get (x)- then I set some values in an empty defined array.

Thank you for you quick answer!
But I still have some questions. Defenitly, I have a conceptual problem which is not described in my books.
All what I did is in my C books (or at least that's what I underestand so far..)

What I wanna do is just a switch or if loop wich -according with a variable I get (x)- then I set some values in an empty defined array.

Okay, listen up. You can't use that type of assignment at run time, only at compile time. The compiler can do that for you, just once, when you compile. The microprocessor cannot do that for you at run time, when it determines what the value of "x" is.

Let me give you another example. You may put, at the top of your program, a statement like

Code:

char myText [] = "This is my text";

That only works because the compiler writers are doing you a favor. You cannot assign a bunch of characters to an array in C/C++. You have to assign them one at a time. In the foregoing example, the compiler runs all the code necessary to assign the characters, individually. It then stores the result permanently, as a series of characters, in the executable file. When the program is launched that pattern is put into memory BEFORE the executive calls your "main" function. It is then there for your program to work with, as it runs. It is impossible for the compiler to know what "x" is before the program runs. It cannot, therefore, put "This is my text" and "That was my text" in the memory location which has been named "myText".

I'm sorry if this is confusing to you. You will either have to take my word for it, or think about it, or back your *** off into assembly language and try to put two different values in the same variable at the same time. It ainna gonna woik, Bubba.