I have included string, iostream etc and used namespace std,
So the compiler doesnt show an error.
But when i use the getname function in my program,
in the .exe file at the moment when it should get the name from user input, it does... Nothing .
So... If i list another thing after getline , e.g. a cout of the entered name: it does nothing -> it just skips the getline!
I knew all that too but my problem is not to build that func or to use it but that the console application does nothing when its at the turn of getline.
Note: im using Orwell Dev C++ 4.9.9.2
Updating to a newer version isn't going to solve your problem (not even sure there is one anyways). Though using a more recent compiler would be recommended (devcpp isn't a compiler).
I've never seen getline function in the manor you've described it other than: Are you building a window application that has no console ? Are you calling the correct getname function ?
> I knew all that too
> but my problem is not to build that func or to use it
If you know about it then you wouldn't have this issue.
You are passing the string by value, then you simply discard its content and fill it with the user input.
The parameter is useless like that.
I suppose that your intention was to pass by reference.
> it does nothing -> it just skips the getline!
maybe you leave a '\n' in the buffer.
Try cin.ignore();