Error C2108 in english please??
i keep getting the error:
"error C2108: subscript is not of integral type"
can anyone tell me what this means in english? i looked over the msdn but they told me the same thing.
July 22, 2003 01:35 PM
You are probably not using the correct data type for an array subscript. Post some code.
GLuint Draw_Triangles(){ int v1, v2, v3; map = glGenLists(1); glNewList(map, GL_COMPILE); for(int loop1=0; loop1<num_obj; loop1++) { glBegin(GL_TRIANGLES); for(int loop2=0; loop2<Mesh_array[loop1].num_faces; loop2++) { v1 = Mesh_array[loop1].vertex[Mesh_array[loop1].face[loop2].x]->x; v2 = Mesh_array[loop1].vertex[Mesh_array[loop1].face[loop2].x]->y; v3 = Mesh_array[loop1].vertex[Mesh_array[loop1].face[loop2].x]->z; glVertex3f(v1, v2, v3); v1 = Mesh_array[loop1].vertex[Mesh_array[loop1].face[loop2].y]->x; v2 = Mesh_array[loop1].vertex[Mesh_array[loop1].face[loop2].y]->y; v3 = Mesh_array[loop1].vertex[Mesh_array[loop1].face[loop2].y]->z; glVertex3f(v1, v2, v3); v1 = Mesh_array[loop1].vertex[Mesh_array[loop1].face[loop2].z]->x; v2 = Mesh_array[loop1].vertex[Mesh_array[loop1].face[loop2].z]->y; v3 = Mesh_array[loop1].vertex[Mesh_array[loop1].face[loop2].z]->z; glVertex3f(v1, v2, v3); } glEnd(); } glEndList(); return map;}
".vertex" is a struct of 3 values for vertices. ".face" is also. hope this helps.
Mesh_array[loop1].face[loop2].x <- my guess is that x is a float and subscripts like integers.
ASCII stupid question, get a stupid ANSI
it means you''re using a non-integral type as a subscript.. like uh.. a float, or double, or char, etc..
for example, the following code would produce that error:
because x is not of an integral type
-eldee
;another space monkey;
[ Forced Evolution Studios ]
for example, the following code would produce that error:
for(double x = 0; x < 10; x++){ myarray[x] = 0;}
because x is not of an integral type
-eldee
;another space monkey;
[ Forced Evolution Studios ]
Do NOT let Dr. Mario touch your genitals. He is not a real doctor!
-eldee;another space monkey;[ Forced Evolution Studios ]
i changed the data types to int and it compiles and everything. now im just having the problem of it crashing. it just runs and then says "would you like to send error information to microsoft..." like thats going to work. anyway does anyone see a memory leak or maybe just somethin that would cause it to crash?
thanks for the tip to change the data types
thanks for the tip to change the data types
dammit dammit dammit!!! this error: "The thread 0xB4 has exited with code -1073741819 (0xC0000005)" means there is a range checking error right?!? if there is any other meaning to this PLEASE tell me.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement