I am trying to make the "Hello World" program work. every time I compile it when I try to run it a window pops of for a split second then disapears. The dev-c++ doesn't say there are any errors or anything else for that matter.
How do i get the program to run?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2007-11-22
Two weeks on from the last post tt this thread, you can be sure that this simple and frequently asked question has been answered or that the OP has moved on!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Please make it a habit to look around a forum before posting a question.
Had you done that, you would have seen a thread in this forum titled
"PLEASE READ BEFORE POSTING A QUESTION" - yep, it is in all capitals -
and, you would have found your question is answered there already.
Wayne
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks Wayne. I read that first but only for the 3 basic questions to be answered part. Although what was wrong with my script? i copied it right out of the help on dev-c++ tutorial:
include <stdio.h>
int main()
{
printf("Hello World\n");
return 0;
}
It looks nothing like what you put.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
A further point of reference. Most of what goes on when you program is not magic - despite the impression we sometime try to give.
In this case, the process is really simple, when you think about it. Your program does what you tell it to do - and then it finishes. You gave the computer no direction as to what to do then, so it closed up shop and quit.
To get around this, you have to keep the program from finishing. The method I pointed you to - the use of 'pause' is one such way. You could also do the same thing with an input statement.
Programming is like giving directions to a young child - if you don't tell it everything, things may happen you do not expect.
Wayne
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2007-11-01
>> How do i get the program to run?
You did. It ran to completion. Upon completion the OS closes an applications window. This only ever seems to surprise people when they write their own code! ;-) Exactly the kind of people you would hope knew what was going on.
Had you read the "PLEASE READ BEFORE POSTING A QUESTION" you'd see that this is addresses there. YOu seem to have an alternative definition for "BEFORE".
Another way of getting it to work is to use "Hello World" project template which incorporates the solution proposed in the above: File->New->New project->Introductory.
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2007-11-01
>> ...but only for the 3 basic questions to be answered part.
And yet you still never provided that information!
>> i copied it right out of the help on dev-c++ tutorial
I would not bother with that tutorial, it is old and badly written and only applies to C not C++ code.
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hey, I use the Dev-C++ 4.9.9.2.
I am trying to make the "Hello World" program work. every time I compile it when I try to run it a window pops of for a split second then disapears. The dev-c++ doesn't say there are any errors or anything else for that matter.
How do i get the program to run?
// hello world!
include <iostream>
using namespace std;
int main()
{
cout<<"Hello World\n";
cin.get();
return 0;
}
This should work I think.
Two weeks on from the last post tt this thread, you can be sure that this simple and frequently asked question has been answered or that the OP has moved on!
PS: I have Windows XP
Please make it a habit to look around a forum before posting a question.
Had you done that, you would have seen a thread in this forum titled
"PLEASE READ BEFORE POSTING A QUESTION" - yep, it is in all capitals -
and, you would have found your question is answered there already.
Wayne
Thanks Wayne. I read that first but only for the 3 basic questions to be answered part. Although what was wrong with my script? i copied it right out of the help on dev-c++ tutorial:
include <stdio.h>
int main()
{
printf("Hello World\n");
return 0;
}
It looks nothing like what you put.
Why are you asking the same question again?
As I said earlier it is answered directly in the thread I pointed you to.
You will have to read past the first section that you stopped at before - but your EXACT question is answered there.
When you read it, you will see what is missing from your code.
The 'help' file is a long abandoned POS - don't bother with it. You can find a world of more useful information in the Please Read thread.
Wayne
A further point of reference. Most of what goes on when you program is not magic - despite the impression we sometime try to give.
In this case, the process is really simple, when you think about it. Your program does what you tell it to do - and then it finishes. You gave the computer no direction as to what to do then, so it closed up shop and quit.
To get around this, you have to keep the program from finishing. The method I pointed you to - the use of 'pause' is one such way. You could also do the same thing with an input statement.
Programming is like giving directions to a young child - if you don't tell it everything, things may happen you do not expect.
Wayne
>> How do i get the program to run?
You did. It ran to completion. Upon completion the OS closes an applications window. This only ever seems to surprise people when they write their own code! ;-) Exactly the kind of people you would hope knew what was going on.
Had you read the "PLEASE READ BEFORE POSTING A QUESTION" you'd see that this is addresses there. YOu seem to have an alternative definition for "BEFORE".
Another way of getting it to work is to use "Hello World" project template which incorporates the solution proposed in the above: File->New->New project->Introductory.
Clifford
>> ...but only for the 3 basic questions to be answered part.
And yet you still never provided that information!
>> i copied it right out of the help on dev-c++ tutorial
I would not bother with that tutorial, it is old and badly written and only applies to C not C++ code.
Clifford
Just Include the " getchar(); , as it is appears down
include <stdio.h>
int main()
{
printf("Hello World\n");
getchar();
return 0;
}
That way lies madness!