Using Xcode with C ++ I am trying to create a simple console application. However, my use of cout and cin does not seem to work as I expect.
I expect:
Testing: 12
input was 12
edit: I cut the code as much as possible:
#include <iostream>
int main(int argc, const char * argv[]) {
int num;
std::cout << "Testing: ";
std::cin >> num;
std::cout << "input was " << num << std::endl;
return 0;
}
Output Example:
12
Testing: input was 12
Program ended with exit code: 0
Am I missing something here?
source
share