I'm not new to programming but I am new to C++ using Xcode as the IDE. I am not allowed to use cout << "hello"; to print, the compiler complains and only works when I use std:cout <<. What setting in Xcode should be fixed in order to get this working the way I'm supposed to write it for class? Thanks!
Asked
Active
Viewed 9,638 times
2 Answers
7
Add using std::cout; somewhere close to the start of your program, after the includes.
Please avoid the temptation to use using namespace std;. It's really a bad habit. Just because you see other people doing it, doesn't make it right. See the FAQ: Why is "using namespace std" considered bad practice?
(Or, of course, you could just get use to typing std::cout.)
0
I had the same problem but I fixed it. You can simply write the following after the #include:
using namespace std;
double-beep
- 5,031
- 17
- 33
- 41