[RESOLVED] Output isn't showing-VBForums
Results 1 to 3 of 3

Thread: [RESOLVED] Output isn't showing

  1. #1

    Thread Starter
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    4,423

    Resolved [RESOLVED] Output isn't showing

    I'm trying desperately to learn C++, with that being said... When I debug:

    c++ Code:
    1. #include <iostream>
    2. using namespace std;
    3.  
    4. int main ()
    5. {
    6.   cout << "Hello World!";
    7.   return 0;
    8. }

    a window pops up and disappears and in my build menu this comes up:
    Loaded 'C:\Documents and Settings\PC #6\My Documents\Visual Studio 2010\Projects\unique\Debug\unique.exe', Symbols loaded.
    Loaded 'C:\WINDOWS\system32\ntdll.dll', Cannot find or open the PDB file
    Loaded 'C:\WINDOWS\system32\kernel32.dll', Cannot find or open the PDB file
    Loaded 'C:\WINDOWS\system32\msvcp100d.dll', Cannot find or open the PDB file
    Loaded 'C:\WINDOWS\system32\msvcr100d.dll', Cannot find or open the PDB file
    The program '[1912] unique.exe: Native' has exited with code 0 (0x0).
    Why isn't hello world being printed on a command prompt?

  2. #2
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Output isn't showing

    That is the debug output.
    You are writing to the standard output, which in this case is the console windows output. You're just not seeing it because the window closes so fast.
    You can always read from stdin at the end of your main method to force the application so stay alive until the user presses enter.
    Code:
    #include <iostream>
    using namespace std;
     
    int main ()
    {
      cout << "Hello World!";
      getchar();
      return 0;
    }
    ---My Flickr photo (mostly screenshots these days!) stream. Have a look!

    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    TCP client/server connection | Retrieving the EventHandler for any Event by code.
    Me on.. BitBucket, Google Code, Github (pretty empty)

  3. #3

    Thread Starter
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    4,423

    Re: Output isn't showing

    Ah ok, sorta like Console.ReadLine()

    Thank you Atheist!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.