cplusplus.com cplusplus.com
cplusplus.com   C++ : Forums : General C++ Programming : the [] operator
  Search:
- -
C++
Information
Documentation
Reference
Articles
Sourcecode
Forums
Forums
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Articles
Lounge
Jobs

-

post  the [] operator

Alphy11 (5)
how would i make it so that i could use a function such as

class class1;
class1[5];

the 5 as parameters
|
Mitsakos (343)
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
|
Evote (25)
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
|

This topic is archived - New replies not allowed.
Home page | Privacy policy
© cplusplus.com, 2000-2008 - All rights reserved - v2.2
Spotted an error? contact us