problem with getline

i'm trying to get my program to receive a line from the user. cin didn't work bcos i wanted to receive more than a word. so i used getline(std::cin,line,'\n').
it compiles fine, but when executed, that part is skipped. i think it may have something to do with the fact that there is a system("pause") right before the getline and i think the program takes the return that is entered there as the terminator for the getline. how do i fix this?

oh right. can't believe that beat me. thanks
Last edited on
I guess that removing system("PAUSE"); should do the trick.
You don't need to pause manually waiting for user input, the program will wait until the user inputs the data.
system commands are generally a bad idea anyway. do not use them if you do not know how to properly use them.
Topic archived. No new replies allowed.