why does this error
result from this codeCode:error C2057: expected constant expression
I want to avoid using malloc.Code:int foo(char *bar)
{
char blob[strlen(bar)];
...
Printable View
why does this error
result from this codeCode:error C2057: expected constant expression
I want to avoid using malloc.Code:int foo(char *bar)
{
char blob[strlen(bar)];
...
anytype ARRAY[must be constant ];
If you need variable size...... malloc() it.
well it works now after i've turned off a few project options.
msvc sucks.
Its not msvc that sucks its c itself. c89 definately prohibits variable sized arrays. c99 may allow it. im not sure. I suppose if you turn on the c99 compile switch it may compile. What have you got against malloc?
Dontcha just love ppl who still can't tell the difference between C and C++