Xcode: C++ program stops in the middle of the code
Hello fellow C++ developers, I'm a novice in C++ programming. This is my code:
//
// main.cpp
// Test
//
// Created by (USERNAME) on 5/19/13.
// Copyright (c) 2013 (USERNAME). All rights reserved.
//
#include <iostream>
int main(int argc, const char * argv[])
{
usingnamespace std;
cout << "Hello world!" << endl;
cout << "Enter a word: ";
string word = "";
cin >> word;
cout << "You entered: \"" << word << "\"" << endl;
string name = "";
cout << "Enter your name: ";
cin >> name;
cout << "Hello, " << name << ", my name is Computer." << endl;
cout << "I am a C++ program" << endl; //Program terminates here
string worda = "";
cout << "Enter another word: ";
cin >> worda;
cout << "You entered: \"" << worda << "\"" << endl;
return 0;
}
Does anyone understand why this is (the program terminates there)?