I suppose I'm learning the true definition of a 'bug.'
I guess it's just an error, mistake or otherwise incompetence that 'bugs' you so to speak.
http://i1299.photobucket.com/albums/ag70/blink3290/firstcprojectBUG_zpse06c0924.jpg
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{ int MyAge; string MyName, MyCity;
cout<<"What is your age?"<<endl;
cin>>MyAge;
cout<<"Ok. You're " << MyAge << "." <<endl;
cout<<endl;
cout<<"What is your name?"<<endl;
getline(cin, MyName);
cout<<"You're name is " << MyName << "? Ok."<<endl;
cout<<endl;
cout<<"What city do you live in?"<<endl;
cin>>MyCity;
cout<<"Oh, you live in " << MyCity << ". Ok."<<endl;
cout<<endl;
cout<<"Here's my information: "" My name is " <<MyName<<"," " I'm "<<MyAge<< " and I live in "<<MyCity<<"."<<endl;
system("Pause");
return EXIT_SUCCESS;
As you can see when I entered my name as Detective Jon Kimble it answers the second following as well using that input.
What is the cause of this problem that I have created? I imagine one way to solve it would be to specify to the person to use first middle and last name but I don't know how to set a multi-word memory spot. or would I have to make 3 strings? MyFirstN, MyMiddleN, MyLastN... and if the person only enters a first name would it just mean the other strings go unused?
Also if this is a dumb question please tell me so I can set a higher standard for myself.