Thread: Totally new user having startup problems.

  1. #1
    Registered User
    Join Date
    Oct 2005
    Posts
    10

    Question Totally new user having startup problems.

    Hi, I've decided to get stuck into learning the C++ language, I've downloaded and installed Microsoft Visual C++ express along with the Windows SDK and configured express to use it.

    Now all i'm trying to do is execute this simple "hello world" program,

    -------------------------------
    Code:
    #include <iostream.h>
    
    using namespace std;
    
    int main()
    {
    	cout << "Hi";
    	cin.get();
    
    	return 1;
    }
    -------------------------------

    However the debugger is giving me this;

    'Hello World.exe': Loaded 'C:\Documents and Settings\Gareth\My Documents\Visual Studio 2005\Projects\Hello World\Hello World\Debug\Hello World.exe', Symbols loaded.
    'Hello World.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', No symbols loaded.
    'Hello World.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', No symbols loaded.
    'Hello World.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc 8b3b9a1e18e3b_8.0.50215.4652_x-ww_a12cf373\msvcr80d.dll', No symbols loaded.
    'Hello World.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', No symbols loaded.
    The program '[2784] Hello World.exe: Native' has exited with code 0 (0x0).

    I get a command window open but it instantly closes itself again.

    any ideas?

    Thanks, Gareth.

  2. #2
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    Yup.

    Code:
    #include <iostream>  // no .h
    
    using namespace std;
    
    int main() {
        cout << "Hi";
        cin.get();
    
        return 0;  // 0 indicates success; 1 indicates failure. Return 0.
    }
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  3. #3
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    If that still doesn't work, execute the program from the command line. Or . . . no, wait! I have it! don't execute the program from the debugger. The debugger always does that. Just choose Compile->Run or something.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  4. #4
    Registered User
    Join Date
    Oct 2005
    Posts
    10
    Excellent, worked a treat, thanks alot.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. still problems with ceasar shift
    By trevordunstan in forum C Programming
    Replies: 2
    Last Post: 09-14-2008, 01:49 AM
  2. Factorial
    By foxman in forum Contests Board
    Replies: 27
    Last Post: 07-11-2008, 06:59 PM
  3. Following CTools
    By EstateMatt in forum C Programming
    Replies: 5
    Last Post: 06-26-2008, 10:10 AM
  4. Instant messenger app help
    By AusTex in forum C Programming
    Replies: 2
    Last Post: 05-01-2005, 12:41 AM
  5. comparing user input
    By lambs4 in forum C Programming
    Replies: 5
    Last Post: 12-15-2002, 10:28 AM