I've finished my first year in a computing degree and I'm trying to get myself ahead of the game by learning some C++.
I'm having some trouble making getline work in the desired way. At the moment I'm doing little more then asking the user to input an int and then 2 strings however the program seems to be passing over the first getline in my code completly. I'm programming on Microsoft Visual Studio 2008.
Here's my source code
#include <iostream>
#include <string>
using namespace std;
The input stream has an Enter from the previous cin and it doesn't stop for the getline(). Try using a cin.ignore() before the first getline() to clear it.
I'm going through this book "learn C++ by making games" already found one problem as it asks you to make a program with strings without putting the #include <string> at the beginning... good start eh?
Anyhow thanks for this, I shall try it once I get home tonight.