hi everyone... i am just a begginer with a c++ and i need your help... what i want to do is following:
enter an array of characters and after delete everything from the buffer after ' ' (white space) appears. it looks very simple but i am having big problems while using cin.getline, cin.clear or cin.ignore... it works when i do this:
cin.getline(name, 255, ' '); and then
cin.clear();
cin.ignore(255, ' ');
but in this case if i enter a name without space it keeps waiting to input a space.
any sugestions???
many thanks
vanco
enter an array of characters and after delete everything from the buffer after ' ' (white space) appears. it looks very simple but i am having big problems while using cin.getline, cin.clear or cin.ignore... it works when i do this:
cin.getline(name, 255, ' '); and then
cin.clear();
cin.ignore(255, ' ');
but in this case if i enter a name without space it keeps waiting to input a space.
any sugestions???
many thanks
vanco