Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

C++ Class/saving question

Name: _OP_ 2010-05-10 1:41

I'm trying to take the input of a full name in my main, and save it to as first, middle, last parts of the name. I'm am having major problems moving from my Student class to the Name class. Any ideas/help?
[code]
class Student{
public:
 Student();
 void SetName(istream &, Student &);
private:
 Name N;
};

void Student::SetName(istream & in, Student & S){
    in.getline(S.N.SetFirst(), 10); //???
}

class Name{
public:
 Name()
 bool SetFirst(char *);
private:
 char * First;
 char * Middle;
 char * Last;
};

bool Name::SetFirst(char * F){
    First = F;
    return true;
}

void main(){
cout << "Enter Student's name(First Middle Last): ";
cin >> ???
}

Name: Anonymous 2010-05-10 1:48

>>1
Name class
IHBT

Name: Anonymous 2010-05-10 1:58

no troll, just can't see my problem.

Name: Anonymous 2010-05-10 2:03

>>3
your problem is you're using sepples.

Name: Anonymous 2010-05-10 3:01

>>3
Your code is incomplete.  Also there is no ??? operator in sepples.

Name: Anonymous 2010-05-10 3:10

blech. /prog/ is not your tutor. besides, sepples is fucking awful

Name: Anonymous 2010-05-10 3:20

Name class has only three fields

Name: Anonymous 2010-05-10 4:18

>>5
That's a comment, not an operator

Name: Anonymous 2010-05-10 5:12

>>8
Neither does sepples support comments delimited by >>.  Now you have four problems.

Name: Anonymous 2010-05-10 13:40

[/code]
Should display properly now.

Name: Anonymous 2011-01-31 21:01

<-- check em dubz

Don't change these.
Name: Email:
Entire Thread Thread List