We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Confused
Topic Started: Nov 25 2005, 03:01 PM (116 Views)
Woody.
Member Avatar
¬_¬
[ *  *  *  *  *  *  * ]
:S Ok, so I use Bloodshed Complier, I used this tutorial, but that code didn't work when I ran it, it flashes for a second then goes, is their any reason why? :huh:

Thanks.
Offline Profile Quote Post Goto Top
 
Myriad
Member Avatar
Member
[ *  *  *  *  *  * ]
If you just double-click the executable it closes immediately after the program is complete. So what you want to do is open up the command line and 'cd' to the directory the exetuable is in and then run the executable from within the command line.

Say I had that file in My Documents.

1. Start -> Run
2. Type in 'cmd'
3. Type in 'cd my documents'
4. Type in 'filename.exe'
Offline Profile Quote Post Goto Top
 
Woody.
Member Avatar
¬_¬
[ *  *  *  *  *  *  * ]
Yeah, but it's odd how this works ( the one that the program gives you )
Code:
 
#include <iostream>

using namespace std;

int main (int argc, char *argv[])
{
 cout << "Hello World!" << endl;
 cout << "Press ENTER to continue..." << endl;
 cin.get();
 return 0;
}


and this one doesn't....
Code:
 
// my first program in C++

#include <iostream>
using namespace std;

int main ()
{
 cout << "Hello World!";
 return 0;
}
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Technology Chat · Next Topic »
Add Reply