View Single Post
Old Apr 13th, 2005, 9:14 AM   #10
spydoor
Programmer
 
Join Date: Feb 2005
Posts: 64
Rep Power: 4 spydoor is on a distinguished road
wierd.. you thought of the answer but don't know why.

cin >> name;  // reads up to whitespace, newline , or EOF

so you were never reading in a space to begin with.

cin.getline(name, length); // reads up to newline, or EOF

Last edited by spydoor; Apr 13th, 2005 at 9:21 AM.
spydoor is offline   Reply With Quote