Hi all,

Could someone tell me what's wrong with this code? I'm using MS Visual C++ IDE and I'm getting a syntax error when compiling this program.


struct _test
    int iNum[5];

typedef struct _test test;

int main(int argc, char** argv)
    test newTest;

    newTest.iNum = {1,2,3,4,5};

Just because the array is a member of a structure doesn't mean you can suddenly assign to it. Array assignment isn't allowed in C, but you can do a structure initialization to the same effect:

test newTest = {1,2,3,4,5};
commented: omg I just noticed your new site. It's soooo cute, with its new colour scheme and the javascript in the code. :) +11