English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

im very much noob here (just started it 2days ago lol) im using Dev C++ Bloodshed Software (lol dont know how to say it in correct technical grammar).

Hello World is d most basic (like hacking pinball scores when using CE) but my problem is after i compile d source file and run it, the only thing that happens is that the command prompt (or command.com whatever) flashes for only a few milliseconds. I cant see then if the messege "Hello World" had appeard...


help me pls.. lol


when creating hello world, is it at new source file? or at new project? or at new resouce file? lol pls support d noob thnx !

2007-01-19 02:55:17 · 7 answers · asked by mark 1 in Computers & Internet Programming & Design

7 answers

Hi,

Try creating a batch file to run your program and put pause as the last command e.g.

myapp.exe
pause

saved as myapp.bat


When you run this the window should stay on the screen for you to read until a key is pressed.

It is most likely a new project (console app)

2007-01-19 03:01:56 · answer #1 · answered by Anonymous · 0 2

put this statement right before return 0 in your int main function

system("pause");

example...
#include
using namespace std;
int main()
{
//all code here
cout << "almost done with program, going to stop here" << endl;
system("pause");
return 0;
}

this will give a message to push a key to continue to the end of the program.

to answer your questions...

DEV C++ is called a compiler
helloworld.cpp is called a source file
helloworld.cpp and other files relating to it, such as helloworld.h would be considered a project (which means your into more advanced programming stuffs)
and helloworld.exe would be a new program, created by you.

I don't really think your a noob, your more of a newbie

2007-01-19 03:25:47 · answer #2 · answered by D 4 · 3 0

Here ya go.
Using Dev-C++ (The compiler that you use aswell)
I have coded a simple Hello World program for you
and even added some comments on what-does-what.
(Also, you want to make a new source file.)


//Pre-Processor directives
#include
#include // for getch();

//Specified namespace
using namespace std;

int main()
{
//Cout object
cout << "Hello world";

//Get keyboard input.
getch();
}


Enjoy,
- Void

2007-01-22 13:03:32 · answer #3 · answered by Hex 5 · 0 0

a). Run your compiled program from the command line.
or
b). Set a breakpoint on your program's return statement
or
c) Step through the program using the debugger.
or
d) Add the line of code:
while(1);
to create an infinite loop.

If you don't know how to do step b or c, you are eventually going to learn, so pull out the manual now and learn how to do it.

2007-01-19 05:34:08 · answer #4 · answered by rt11guru 6 · 0 1

The problem is that your IDE runs the program and closes it before you can see it.. there should be an option to not have it do that... or you can put a breakpoint in the program and have the debugger stop at that point... or... you can open a command window and execute the program from there... (probably the best option)... although the batch idea issued before isn't a bad option either...

2007-01-19 03:08:14 · answer #5 · answered by AvidBeerDrinker 3 · 0 2

a million.) 865ccb4ab0e063e5caa3387c1a8741s th865ccb4ab0e063e5caa3387c1a8741s what you propose?: for (865ccb4ab0e063e5caa3387c1a8741nt i=0; i<9; i++) { cout << myarray[i]; } 2.) i myself havent used matr865ccb4ab0e063e5caa3387c1a8741ces lots T_T so which you will could ask somebody else or use google =P

2016-12-16 08:17:06 · answer #6 · answered by ? 4 · 0 0

Just try out by giving
getch();
(or)
getche();
just before the closing of main()
It ll wait for u to see the message.
You have to include
#include

2007-01-19 04:32:40 · answer #7 · answered by Sudha P 2 · 1 0

fedest.com, questions and answers