0% found this document useful (0 votes)
46 views2 pages

Student 890

This C++ code defines a function that adds a new student to a class by allocating memory for a student object, initializing it with a given name and social security number, adding it to the class object, and returning a pointer to the new student object.

Uploaded by

EyQa PeYrak
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views2 pages

Student 890

This C++ code defines a function that adds a new student to a class by allocating memory for a student object, initializing it with a given name and social security number, adding it to the class object, and returning a pointer to the new student object.

Uploaded by

EyQa PeYrak
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

#include"student.

h"

#include"MyClass.h"

Student*addNewStudent[MyClass myObject,

char*pName,

SSNumber ss)

Student*p5;

if(pName!=0)

pS=new Student(pName,ss);

myObject.addStudent(pS);

return pS;

You might also like