I am really screwed up! What's wrong here?Code:char foooo()[10] { static char a[10]; return a; }
I am really screwed up! What's wrong here?Code:char foooo()[10] { static char a[10]; return a; }
More like:
Though have you considered encapsulating this in a class instead?Code:char* foooo() { static char a[10]; return a; }
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
so this was a syntax error? really?
when i write it like this:
my compiler reports that the function returns array! i am using MSVS .Net 2003.Code:char foooo()[10] { }
I think the problem is that functions cannot return arrays. They can, however, return pointers to arrays.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)