question about using functions and structures...

What i understand is that you want to use severals 3dcube variables but the exact count is defined at runtime, where the final user is able to add more and more new 3dcube variables.

Yes, this is perfectly posible but not in the way that you are trying to do using string names for bind the variables with the code, the “C” language is compiled mean that at run time all variables names used in the code have not meaning anymore, those names are used when the compiler is bulding the EXE file.

For defining new variables at runtime you need to declare a dinamic array of type 3dcube, each time the user want to add a new 3dcube variable then add a new element and keep count how much elements the array has.
In the render rutine you have to draw all elements in the array.

good luck.

Turbo Pascal.

thanks guys! I will try your idea Turbo Pascal…and thanks for your id_tag idea… I had something else(something really stupid) in mind for the rendering process.

-Aditya

No problem…

Originally posted by adityagaddam:
[b]thanks guys! I will try your idea Turbo Pascal…and thanks for your id_tag idea… I had something else(something really stupid) in mind for the rendering process.

-Aditya[/b]

Can structures have private or protected members or is it just classes?

Structures are just classes where all the members are public by default. So of course, you can still use the private\protected\public keywords therein.

Is there are virtual functions in normal C?
Can structures inherit each other in normal C?

Originally posted by valmian:
[b]Is there are virtual functions in normal C?
Can structures inherit each other in normal C?

[/b]

No

Also, in C++ structs and classes can have member functions; in C they can only have data members (and there are no classes). This, inheritance, and overloading are the main differences between the two.