fork download
  1. #include <iostream>
  2. #include <typeinfo>
  3. int main()
  4. {
  5. int a;
  6. char *c;
  7. cout << "The type of a is: " << typeid(a).name() << endl;
  8. cout << "The type of c is: " << typeid(c).name() << endl;
  9. return 0;
  10. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:7:1: error: ‘cout’ was not declared in this scope
 cout << "The type of a is: " << typeid(a).name() << endl;
 ^~~~
prog.cpp:7:1: note: suggested alternative:
In file included from prog.cpp:1:0:
/usr/include/c++/6/iostream:61:18: note:   ‘std::cout’
   extern ostream cout;  /// Linked to standard output
                  ^~~~
prog.cpp:7:53: error: ‘endl’ was not declared in this scope
 cout << "The type of a is: " << typeid(a).name() << endl;
                                                     ^~~~
prog.cpp:7:53: note: suggested alternative:
In file included from /usr/include/c++/6/iostream:39:0,
                 from prog.cpp:1:
/usr/include/c++/6/ostream:590:5: note:   ‘std::endl’
     endl(basic_ostream<_CharT, _Traits>& __os)
     ^~~~
stdout
Standard output is empty