converting to a constant
I have been working on a simple program that reads a number from a text file and then implements that number into an array bracket...
example:
File>>chOut;
scanf(chOut,"%d",&tri);
TRI*TRIptr[tri];
The problem is that ''tri'' must be a constant, right? Please show me how to convert tri to a const. Thank ya...
-Later
eh sorry about the above ...anyways....
scanf(chOut,"%d",&tri); im gathering is actually "sscanf"
TRIptr[tri]; should be fine for referencing
but the whole line "TRI*TRIptr[tri];"
doent make much sence TRI = TRIptr[tri] would.
what are you trying to do here ?
scanf(chOut,"%d",&tri); im gathering is actually "sscanf"
TRIptr[tri]; should be fine for referencing
but the whole line "TRI*TRIptr[tri];"
doent make much sence TRI = TRIptr[tri] would.
what are you trying to do here ?
sorry for the lack of info.
TRI is acually a class. You see I''m working on a very simple glut engine. TRI stands for triangles. I''m reading in how many triangles the engine must make. Every time I run the program, an error tells me that ''tri'' must be constant. Is there any way possible I can convert the integer ''tri'' to a constant?
TRI is acually a class. You see I''m working on a very simple glut engine. TRI stands for triangles. I''m reading in how many triangles the engine must make. Every time I run the program, an error tells me that ''tri'' must be constant. Is there any way possible I can convert the integer ''tri'' to a constant?
sorry for the lack of info.
TRI is acually a class. You see I''m working on a very simple glut engine. TRI stands for triangles. I''m reading in how many triangles the engine must make. Every time I run the program, an error tells me that ''tri'' must be constant. Is there any way possible I can convert the integer ''tri'' to a constant?
TRI is acually a class. You see I''m working on a very simple glut engine. TRI stands for triangles. I''m reading in how many triangles the engine must make. Every time I run the program, an error tells me that ''tri'' must be constant. Is there any way possible I can convert the integer ''tri'' to a constant?
going by that then you should have something like
should work ..
though I still dunno what "TRI*TRIptr[tri];" is suppose to do ?
TRI *triangles;File>>chOut;scanf(chOut,"%d",&tri);triangle = new TRI[tri];
should work ..
though I still dunno what "TRI*TRIptr[tri];" is suppose to do ?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement