On 6 Apr 2004 10:37:16 -0700,
(solartimba) wrote:
>/* The cout<<name<<endl; statement outputs the string "name"
> of the previous input. Whats is wrong. */
>/* pc MS c++ 5.0*/
>
>
>#include <string>
>#include <iostream>
>using namespace std;
>int main()
>{
> string name;
> name =" as";
> while (!(name.empty()))
> {
> cout<<" enter name : "<<endl;
> getline(cin,name);
> cout<<name<<endl;
>
> }
> cout<<"ok "<< name<<endl;
> return (0);
>}
http://www.dinkumware.com/vc_fixes.html
(search for "getline")
-leor
--
Leor Zolman --- BD Software ---
www.bdsoft.com
On-Site Training in C/C++, Java, Perl and Unix
C++ users: Download BD Software's free STL Error Message Decryptor at:
www.bdsoft.com/tools/stlfilt.html