Thread: I'm new to VC++

  1. #1
    Registered User
    Join Date
    Apr 2005
    Posts
    76

    I'm new to VC++

    Ok, you Visual Studio people out there probably will laugh at this... but o well...

    Here is some simple code that works fine...its just that when it reaches return 0; it displays "Press a key to continue..." and I don't have system("Pause") anywhere in my code...

    Code:
    int main()
    {
        Menu();
        cout<<"\n\t\t\t       Quitting";
        Sleep(500);
        cout<<".";
        Sleep(500);
        cout<<".";
        Sleep(500);
        cout<<".";
        return 0;
    }
    Are there any settings I should be aware of to disable the automatic system("Pause") thing thats goin on here?

  2. #2
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,613
    Maybe you compiled a debug build or something, compile a release build and see if that pause goes away.

  3. #3
    Registered User
    Join Date
    May 2006
    Posts
    903
    Yes. VC++ does that only when you are in Debug mode if I recall. Otherwise, run your program through DOS or whatever console you have and run your program, it will not do it.
    Last edited by Desolation; 06-04-2006 at 06:23 PM.

  4. #4
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    I'll resist the urge since it would be beating a dead horse to death.

    Sufficient to say....plz do some research about console before attempting to give advice.

  5. #5
    Registered User
    Join Date
    May 2006
    Posts
    903
    What do you mean ? Smartass.

  6. #6
    Registered User
    Join Date
    Apr 2005
    Posts
    76
    (laughs at above posts)
    Well now I have the code being compiled with a Release Win32 configuration...it still displays the message...

  7. #7
    carry on JaWiB's Avatar
    Join Date
    Feb 2003
    Location
    Seattle, WA
    Posts
    1,972
    I think it only does that if you run it from within Visual Studio. Try going to your Debug or Release folder and double clicking the exe
    "Think not but that I know these things; or think
    I know them not: not therefore am I short
    Of knowing what I ought."
    -John Milton, Paradise Regained (1671)

    "Work hard and it might happen."
    -XSquared

  8. #8
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    Usually if you run your programs from within the ide they will behave in that manner. If you run them from a command prompt both the 'debug' and 'release' builds should behave as expected.

    edit: Beaten by JaWiB.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  9. #9
    Registered User
    Join Date
    May 2006
    Posts
    903
    Quote Originally Posted by Desolation
    Yes. VC++ does that only when you are in Debug mode if I recall. Otherwise, run your program through DOS or whatever console you have and run your program, it will not do it.
    I beat you all to it.

    By the way, by 'console' I meant 'command-line'.

    Edit: And yes you can have a console other than the default one, in the case that you weren't already informed of that..

  10. #10
    Registered User
    Join Date
    Apr 2005
    Posts
    76
    JaWiB was right... its just the IDE configuration...

  11. #11
    Registered User
    Join Date
    May 2006
    Posts
    903
    Know, young padawan, that doing what I said is the very same thing as what JaWiB said. Double-clicking the .exe file or loading it with the command-line is the exact same thing.

  12. #12
    Registered User
    Join Date
    Apr 2005
    Posts
    76
    yea i figured that... but im too lazy... lol
    Im use to the quick button in Dev C++

  13. #13
    Registered User lsctt's Avatar
    Join Date
    Jun 2006
    Posts
    30

    Cool

    Quote Originally Posted by Desolation
    Know, young padawan, that doing what I said is the very same thing as what JaWiB said. Double-clicking the .exe file or loading it with the command-line is the exact same thing.
    your all gunna fight about this forever huh?
    *sigh*
    oh well they'll sort it out eventually...
    I've Found that every obsticle can improve your situation...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to show line no in VC ++
    By mpushkar in forum Tech Board
    Replies: 1
    Last Post: 12-17-2006, 09:33 AM
  2. makefile exported by vc 6.0 doesn't work
    By wow in forum Windows Programming
    Replies: 7
    Last Post: 03-24-2006, 04:20 PM
  3. Can't compile this with VC 6.0
    By uriel2013 in forum C++ Programming
    Replies: 4
    Last Post: 05-31-2003, 07:43 PM
  4. VC 7.0 and templates
    By Mongush in forum C++ Programming
    Replies: 12
    Last Post: 03-11-2003, 10:32 AM
  5. Why VC?
    By Unregistered in forum Windows Programming
    Replies: 1
    Last Post: 04-15-2002, 05:24 AM