Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Don't want to std::cout?

Kang Long
2008-10-31
2013-04-22
  • Kang Long
    Kang Long
    2008-10-31

    with dev C++ 4.9.9.2, this program can not run:
    #include "iostream.h"
    int main()
    {
    cout<<"hello world";
    return 0;
    }
    I know that replace cout with std::cout will solve this problem. but if I don't want to use std:: ? ( because it's longer than cout)
    I can change something in tool/complier option, and this program will run.
    do you know another way?
    thanks

     
    • I think you'd be better served by asking this question on this forum:
      https://sourceforge.net/forum/forum.php?forum_id=48211

       
    • Tatsh
      Tatsh
      2009-01-05

      just do

      using namespace std;

      before int main()

       
  • john mccain
    john mccain
    2009-09-12

    or use
    #include &lt;iostream.h&gt;
    and when calling cout add std::cout
    std:: is a class like class std{
    cout(void* x){ printf(&quot;%s&quot;,x );}//a lot complex edition of this function
    }