I'm not sure what I'm missing here. This is a snippet of code that I found on a site and I placed it in my program to see how it works and then I would modify it to my liking later. I am including iostream and this code snippet is in my main function.
char buffer[80];
cout << "Enter the string: ";
cin.get(buffer, 79); // get up to 79 or newline
cout << "Here's the buffer: " << buffer << endl;
What is happening is that the program never asks for the user input. It just seems to print out the two cout statements and then ends. The site where I got the snippet from shows the output of:
Enter the string: Hello World
Here's the buffer: Hello World
cout << "Enter the string: " << endl;?