0% found this document useful (0 votes)
39 views1 page

Student

This C++ code defines a function that adds a new student to a class. It takes in a class object, student name, and social security number. It checks if a name was provided, creates a new student object with the given details, adds it to the class, and returns the student pointer.

Uploaded by

EyQa PeYrak
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
0% found this document useful (0 votes)
39 views1 page

Student

This C++ code defines a function that adds a new student to a class. It takes in a class object, student name, and social security number. It checks if a name was provided, creates a new student object with the given details, adds it to the class, and returns the student pointer.

Uploaded by

EyQa PeYrak
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 1

#include"student.h" #include"MyClass.h" Student*addNewStudent(MyClass myObject, char*pName, SSNumber ss) { Student*pS; if(pName!=0) { pS=new Student(pName,ss); myObject.

addStudent(pS); } return pS; }

You might also like