CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22
  1. #16
    Join Date
    Jan 2009
    Location
    IN my computer,
    Posts
    24

    Re: Complies but doesn't run

    any way i think its a good idea for a new programmer to get into the habit of commenting their code. but thats me.

    So! Rayman any other problems?

    Another thing you might want to do is use <cstdio> (include it), it lets you use Command Prompt comands, pause, cls, ect. used by system("commnd"), example system("pause")
    i use pause A LOT!!!!

    Really makes things easier
    Last edited by H aun; January 24th, 2009 at 03:45 PM. Reason: more info, correcting info

  2. #17
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    6,765

    Re: Complies but doesn't run

    Quote Originally Posted by H aun
    any way i think its a good idea for a new programmer to get into the habit of commenting their code.
    It is, but one must also learn not just to comment but to comment appropriately.

    Quote Originally Posted by H aun
    Another thing you might want to do is use cstdio (include it), it lets you use Command Prompt comands, pause, cls, ect. used by system("commnd"), example system("pause")
    i use pause A LOT!!!!

    Really makes things easier
    It does? It sounds like you are simulating a debugger, but back in post #2 Paul McKenzie already suggested that Rayman452 learn how to use a debugger.
    C + C++ Compiler: MinGW port of GCC
    Build + Version Control System: SCons + Bazaar

    Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
    Kindly rate my posts if you found them useful

  3. #18
    Join Date
    Jan 2009
    Location
    IN my computer,
    Posts
    24

    Re: Complies but doesn't run

    no, it works in the program

  4. #19
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    6,765

    Re: Complies but doesn't run

    Quote Originally Posted by H aun
    no, it works in the program
    How does it "make things easier"? I do not see how the use of such platform dependent external utilities will benefit Rayman452's program.

    Incidentally, std::system() is found in <cstdlib>, not <cstdio>.
    C + C++ Compiler: MinGW port of GCC
    Build + Version Control System: SCons + Bazaar

    Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
    Kindly rate my posts if you found them useful

  5. #20
    Join Date
    Jan 2009
    Location
    IN my computer,
    Posts
    24

    Re: Complies but doesn't run

    well with out the system("pauses") you need to go into command prompt, then navigate to the executibal and run it.

    You put the pauses in places (well at least for me) when something is read out and nothing is being entered.

    example
    Code:
    void errorcm()
    {
         cout << ent << " Is Not A Command" << '\n' ;
         system("pause");
         system("cls");
    	 help();
    }
    that paused it after displaying
    "asdf" is not a command
    and the cleared it up, so the stuff in help() could be displayed more cleanly

    also im using Dev C++ and system("") is the function for that, and the <cstdio> is not the system stuff, thanks for correcting me.
    Last edited by H aun; January 24th, 2009 at 03:42 PM. Reason: stuff

  6. #21
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    6,765

    Re: Complies but doesn't run

    Quote Originally Posted by H aun
    well with out the system("pauses") you need to go into command prompt, then navigate to the executibal and run it.
    That is the way a command line program is supposed to be run (or you could run it from say, a batch file). Rayman452 is using Visual Studio 2008, and that IDE is likely to keep the console window open when running the program via the IDE. Even if it does not, inserting a break point at the end of the program should be a suitable workaround.
    Last edited by laserlight; January 24th, 2009 at 03:49 PM.
    C + C++ Compiler: MinGW port of GCC
    Build + Version Control System: SCons + Bazaar

    Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
    Kindly rate my posts if you found them useful

  7. #22
    Join Date
    Jan 2009
    Location
    IN my computer,
    Posts
    24

    Re: Complies but doesn't run

    I dipped into Visual studios, always kicked my butt. might dip back in there

Page 2 of 2 FirstFirst 12

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured