hi i cant debug my code ?

hi im just startet at learing c++ i got my code working i dev-c++ but i Visual C++ 2005 Express Edition i cant run or debug my code why

here is my code

#include <iostream>

int main()
{
    std::cout << "show!\n";
    return 0;
}



Answer this question

hi i cant debug my code ?

  • Gary-unisys

    So thats one difference between the two, just different headers, but the same effects    Microsoft Visual C++ 6.0, is what I'm using, and both work on mine, so when using <iostream> you have to include:

    using namespace std;
    std::cin; or std::cout;

    Right I just want to make sure I'm understanding all this correctly.


  • arnaud404

    I'm new to C++ as well and I see a big problem off hand. I see no .h in your library<iostream>. You can fix this several ways.
    If you want to use std::cout you need to do this:

    #include <iostream>
    using namespace std;

    Or this:

    #include <iostream.h>              (if done this way do not use "std::cout", only "cout")

    Now I'm not really sure as to the difference between the two, (only been in C++ for 10 weeks now), but either way should work.


  • Christopher B. Green

    i stille getting a build error

  • Razmattaz1

    Both header files (the old iostream.h and the new iostream) where part of Visual C++ 6.0. Since then, Visual C++ 6.0 came out in 1998, we have completely removed the old file iostream.h.

    The old file, iostream.h, is not conformant to the C++ Standard, while iostream is.

  • clemon79

    To David. You should tell us the build error.

    To Wooten: iostream is a valid header.  I don't think iostream.h exists under VS 2005.

  • Kian Ryan

    What is your problem
    Set a breakpoint at the line with std::cout (F9).
    Press go (F5).

    What happens

  • hi i cant debug my code ?