Reputation: 1
I've been using Xcode 10.0 on my mac and whenever I use cin, the compiler shows an error:
|6|error: use of undeclared identifier cin|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
However, cout
and other c++ built-ins are working just fine...
A few days ago I have commented out some header file in gcc's header file folder for another bug. (Is there any chance to create this problem for what I've done before with the header file folder?)
Upvotes: 0
Views: 201
Reputation: 31447
You need to
#include <iostream>
to be able to use std::cin
. If you want to avoid the std::
namespace prefix, add
using std::cin;
to your code as well.
Upvotes: 1