VC++ question
Can standard edition of Visual C++ 6 make a .exe file, that can be saved and act as a program without a compiler?
If so, can someone please tell me how.
Thanks.
Yes, VC++ Standard is a (non-optimizing) compiler (i.e. produces an .exe), not an interpreter.
How ? Compile your program, then go to the directory where your project is saved, look into the proper subdirectory (usually "Debug" or "Release"), your executable should be there.
[Questions (STFW) | GDNet Start Here | GDNet Search | Forum FAQ | Google | Asking Smart Questions ]
[Docs (RTFM) | MSDN | SGI''s STL | OpenGL | File formats]
[C++ Must Haves (RTFS) | MinGW | Boost | Loki | FLTK | SDL ]
Stolen from Magmai Kai Holmlor, who held it from Oluseyi, who was inspired by Kylotan...
How ? Compile your program, then go to the directory where your project is saved, look into the proper subdirectory (usually "Debug" or "Release"), your executable should be there.
[Questions (STFW) | GDNet Start Here | GDNet Search | Forum FAQ | Google | Asking Smart Questions ]
[Docs (RTFM) | MSDN | SGI''s STL | OpenGL | File formats]
[C++ Must Haves (RTFS) | MinGW | Boost | Loki | FLTK | SDL ]
Stolen from Magmai Kai Holmlor, who held it from Oluseyi, who was inspired by Kylotan...
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
I found the .exe, but when I open it, it opens then closes before I can see what''s on the screen, or if it requires a user to input something, it has the user input whatever and then closes before someone can see what''s on the screen. Any idea how I can fix this?(all of my files are text only and done in dos.)
Thanks.
Thanks.
Console windows (DOS apps) are closed right after they finish. Try adding the getch() statement to wait for a key to be pressed at the end of a program (in conio.h I believe). Then it will close only after the user presses a key.
---------------------------------------------------------------------------------------
Before I couldn''t spell engineer, now I are one.
---------------------------------------------------------------------------------------
Before I couldn''t spell engineer, now I are one.
---------------------------------------------------------------------------------------Before I couldn't spell engineer, now I are one.
Several choices
a)
Don''t double-click them. Open a console window and run them from there
or
b)
Add a call to the getch() function, found in <conio.h> (note, this is a non-portable function call... DOS/Windows only) at the end of main()
If you have calls to exit() in your program, you may want to register getch() with atexit() instead.
[Questions (STFW) | GDNet Start Here | GDNet Search | Forum FAQ | Google | Asking Smart Questions ]
[Docs (RTFM) | MSDN | SGI''s STL | OpenGL | File formats]
[C++ Must Haves (RTFS) | MinGW | Boost | Loki | FLTK | SDL ]
Stolen from Magmai Kai Holmlor, who held it from Oluseyi, who was inspired by Kylotan...
a)
Don''t double-click them. Open a console window and run them from there
or
b)
Add a call to the getch() function, found in <conio.h> (note, this is a non-portable function call... DOS/Windows only) at the end of main()
If you have calls to exit() in your program, you may want to register getch() with atexit() instead.
[Questions (STFW) | GDNet Start Here | GDNet Search | Forum FAQ | Google | Asking Smart Questions ]
[Docs (RTFM) | MSDN | SGI''s STL | OpenGL | File formats]
[C++ Must Haves (RTFS) | MinGW | Boost | Loki | FLTK | SDL ]
Stolen from Magmai Kai Holmlor, who held it from Oluseyi, who was inspired by Kylotan...
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
either put a extra read at the end (before the program closes) or use the getch() funtion from conio.h (I''m sure there is other ways - but this is what comes to mind)
mang?
You can always run the program from MSVC++ by having the workspace open and pressing CTRL + F5 it will build and run the program and add in the end of the program "Press any key to continue" thingy
True hackers are intelligent, they have to be. Either they do really great in school because they have nothing better to do, or they don't do so well because school is terribly boring. And the ones who are bored aren't that way because they don't give a shit about learning anything. A true hacker wants to know everything. They're bored because schools teach the same dull things over and over and over, nothing new, nothing challenging.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement