c arrays: setting size dynamically?

Posted by user336994 on Stack Overflow See other posts from Stack Overflow or by user336994
Published on 2010-05-10T05:52:34Z Indexed on 2010/05/10 6:04 UTC
Read the original article Hit count: 250

Filed under:
|

Hello, I am new to C programming. I am trying to set the size of the array using a variable but I am getting an error: Storage size of 'array' isn't constant !!

01 int bound = bound*4;

02 static GLubyte vertsArray[bound];

I have noticed that when I replace bounds (within the brackets on line 02) with the number say '20', the program would run with no problems. But I am trying to set the size of the array dynamically ...

Any ideas why I am getting this error ? thanks much,

© Stack Overflow or respective owner

Related posts about c

    Related posts about arrays