How can I do the following?
Ohh and the name has to supplyed at runtime.Code:Student *sa[3]; *sa[0] = new Student("James"); *sa[1] = new Student("Jason"); *sa[2] = new Student("Frank");
How can I do the following?
Ohh and the name has to supplyed at runtime.Code:Student *sa[3]; *sa[0] = new Student("James"); *sa[1] = new Student("Jason"); *sa[2] = new Student("Frank");
Last edited by (Slith++); 07-11-2006 at 12:42 AM.
You should be able to figure out how to supply the name at run-time unless there's some specific problem that's going to occur but from the minuscule information you provided I'm not sure how to know what's really going on in your program.Code:Student *sa[3]; sa[0] = new Student("James"); sa[1] = new Student("Jason"); sa[2] = new Student("Frank");
Last edited by Peter5897; 07-11-2006 at 12:51 AM.
I swear I tryed that. Ohh well works now.
Thanks very much
Originally Posted by (Slith++)
You don't need the dereference operator on each element. Remove them.