| MOSKing (13) | |||
|
I have created a file with information pertaining to the information in my class. 1) How do I take in the file? 2) How do I create an array of an class? 3) Will this all connect together in anyway? Here is my masterpiece.
Thank You. | |||
|
Last edited on
|
|||
| Raezzor (223) | |||
|
Without seeing the rest of your files or the code it's hard to say. Have you overloaded the >> and << operators to work with your class? If not, then lines 10, 11 and 15 probably won't work the way you intended them to. To create an array of a class you simply use the same notation you do with built in types. The format is typename variablename[array size];So say I had a class called Furniture and I wanted to declare an array of 10 of them, all called desks. I could declare this as: Furniture deskArray[10];Each element of deskArray is now a type Furniture object. To access them you simply use
where [i] is the element of the object you want to access. | |||
|
Last edited on
|
|||