Hi thanks for looking...
Below is the main method, followed by the student class. I want to pass the string (called name) onto the student class. What am I doing wrong?
#include <iostream.h>
#include <string.h>
#include "student.h"
void main(void)
{
char name[10];
cin.getline(name, 10, '\n');
Person joe(name);
cout<< name;
cout<< joe.display();
int i;
cin >> i;
}
//below is the "student.h" class
class Person
{
char name[10];
public:
Person(char nam[10])
{
name=nam;
}
char display()
{
return name;
}
};