SyntaxFix
Write A Post
Hire A Developer
Questions
Tags
I have a C++ program:
test.cpp
#include<iostream> int main() { char t = 'f'; char *t1; char **t2; cout<<t; //this causes an error, cout was not declared in this scope return 0; }
I get the error:
'cout' was not declared in this scope
Why?
This question is related to c++ iostream cout
c++
iostream
cout
Use std::cout, since cout is defined within the std namespace. Alternatively, add a using std::cout; directive.
std::cout
std
using std::cout;
Source: Stackoverflow.com