TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: FRANK MASINGILL
from: ERIK WARMELINK
date: 1997-05-19 23:06:00
subject: Strings in C++

Frank, you wrote to Cliff Rhodes:
 FM>     Is there a way to enter and retrieve a string like a
 FM> first and last name all in one string using the iostream
 FM> library?  I seem not to have any examples that provide for
 FM> that.  One seems to have to set up for FIRSTNAME and
 FM> LASTNAME as separate strings.
 FM>     If this is wrong, please give me one or two lines that
 FM> show how it CAN be done.
Is this what you are looking for?
  #include 
  int main(void) {
     char name[80];
     cin.get(name, sizeof(name));
     cout << name << endl;
     return 0;
  }
Bye,
 Erik 
---
---------------
* Origin: WarmelinkE@vertis.nl (2:282/608.60)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.