classes and header files

(Work has been removed for a higher purpose)

Thanks you to everyone who helped!
Last edited on
student stu = new student; looks like Java.

In c++ we'd do this:
1
2
student stu;
stu.openfile();


the new keyword is only used when we are creating a new object and assigning it to a pointer like so:
1
2
3
student* stu; // Creating a pointer to a student.  It doesn't point to anything yet
stu = new student; // stu is now pointing to an object
stu = new student[10];/  stu is now an array of 10 students

Last edited on
Topic archived. No new replies allowed.