the [] operator

how would i make it so that i could use a function such as

class class1;
class1[5];

the 5 as parameters
You need to overload the operator [] in order to do something like that.
You can read the tutorial from this site on how to overload operators.
http://www.cplusplus.com/doc/tutorial/classes2.html
hehehe i thought you were trying to make array of classes
ooooh that would be cool
class[1000000] coolness{
Public ............................

Thought i'd share that
Topic archived. No new replies allowed.