-=>Quoting Phil Ohl to All <=-
PO>char name[20];
PO>cout<<"Enter name: ";
PO>getline(name, cin);
PO>It just wont work. How would I remedy this problem without limiting
PO>the user to just their first or last name.
TH> Use the following code:
TH> char name[15];
TH> gets(name,15); //"name" is the string, "15" is the maximum number of
chars
Um.... what compiler do you use that has "gets(char*, int)"?
You need to go to fgets to specify length.
---
---------------
* Origin: Tanktalus' Tower BBS (1:250/102)
|