Using Xcode with c++ I'm trying to create a simple console application. However my usage of cout and cin does not seem to work as I intend it to.
I'm expecting:
Testing: 12
input was 12
edit: i've cut down the code test as much as I can:
#include <iostream>
int main(int argc, const char * argv[]) {
// insert code here...
int num;
std::cout << "Testing: ";
std::cin >> num;
std::cout << "input was " << num << std::endl;
return 0;
}
Sample output:
12
Testing: input was 12
Program ended with exit code: 0
Is there something I'm missing here?