Search Results

Search found 2 results on 1 pages for 'user336994'.

Page 1/1 | 1 

  • c arrays: setting size dynamically?

    - by user336994
    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,

    Read the article

  • size of array passed to C++ function ?

    - by user336994
    Hello, how can I get the size of an array that is passed to a function ? I have this code, but it is not working for me float verts[] = { -1.0,1.0,1.0, 1.0,1.0,1.0, 1.0,-1.0,1.0, -1.0,-1.0,1.0, -1.0,1.0,-1.0, 1.0,1.0,-1.0, 1.0,-1.0,-1.0, -1.0,-1.0,-1.0 }; void makeVectorData(float p_vertData[]) { int num = (sizeof(p_vertData)/sizeof(int)); cout << "output: " << num << endl; }; thanks,

    Read the article

1