473,320 Members | 1,853 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Another beginner question DevC++

IS
I'm using BloodShed DevC++. If you know the program that would be great.

Here is what I'm doing:
File>New>Source File.

Then I enter:

#include <iostream.h>

int main();
int main()
{
cout <<"Hello World!/n";
}

Next I click Save As and name the file "Hello World"

Then I go to Execute and click "Compile". When its done I go back to
Execute and click "Run".

After I click "Run" I only get a split second Command Prompt (Using XP Home)
flashing on my screen. Way too fast for me to even see if there's anything
there.

Am I doing something wrong? . . Or missing some steps?

Thanks.

IS.
Jul 22 '05 #1
3 1698
"IS" <y@y.com> wrote in
news:di***************@newssvr30.news.prodigy.com:
I'm using BloodShed DevC++. If you know the program that would be
great.

Here is what I'm doing:
File>New>Source File.

Then I enter:

#include <iostream.h>
This is non-standard. You should use

#include <iostream>

int main();
This is not necessary.
int main()
{
cout <<"Hello World!/n";
}
You should use

std::cout << "Hello World!/n";

Next I click Save As and name the file "Hello World"

Then I go to Execute and click "Compile". When its done I go back to
Execute and click "Run".

After I click "Run" I only get a split second Command Prompt (Using XP
Home) flashing on my screen. Way too fast for me to even see if
there's anything there.


That's because Windows arranges to display a console window (what you
call a command prompt) only for as long as the program is running. As
soon as the program is finished, the window will go away. So you have two
choices. Either add a statement to wait for the user to press the enter
key before exiting, or open a command window yourself, and run the
program directly instead of from the environment. You can wait for user
input by adding

std::cin.get();

after the cout statement.

Gregg
Jul 22 '05 #2
"IS" <y@y.com> wrote in
news:di***************@newssvr30.news.prodigy.com:
cout <<"Hello World!/n";


You also are using a forward slash where you should be using a backslash. I
incorrectly copied this error in my previous reply. It should be

std::cout << "Hello World!\n";

Gregg
Jul 22 '05 #3
IS wrote:
I'm using BloodShed DevC++. If you know the program that would be great.

Here is what I'm doing:
File>New>Source File.

Then I enter:

#include <iostream.h>

int main();
int main()
{
cout <<"Hello World!/n";
}
#include <iostream>
#include <cstdlib>

int main()
{
std::cout <<"Hello World!\n";
return EXIT_SUCCESS;
}


Next I click Save As and name the file "Hello World"

Then I go to Execute and click "Compile". When its done I go back to
Execute and click "Run".

After I click "Run" I only get a split second Command Prompt (Using XP Home)
flashing on my screen. Way too fast for me to even see if there's anything
there.

Am I doing something wrong? . . Or missing some steps?


As such this is O.T since we dont discuss the IDE / implementation
stuff here. But then, you can fix the problem you had mentioned by
inserting a system("pause") command ..
--
Karthik.
Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Luc The Perverse | last post by:
Hello! I am looking for a beginners tutorial on how to program for windows in C. I guess this is windows API? I have never written outside of VC++ for windows, and can't find any examples. I...
14
by: Craig Buchanan | last post by:
If I have two custom vb.net classes, where 80% of the properties are alike and there is one method with a matching signature, can i cast between one and the other? do i need to have each class...
17
by: Barret Bonden | last post by:
As an old programmer just now looking at VB.net I have a question: How does one simply open one form from another ? I don't mean how does one create a new instance of that form , but rather how...
0
by: webking | last post by:
hi friends, i am using devc++ to do c programs but i am unable to use standard turbo c functon such as getch(), clrscr(),getchar () can any one...
1
by: Michael Sgier | last post by:
Hi how can i import an existing Windows Devc++ project in kdevelop? thx Michael
28
by: angeluslii | last post by:
Which IDE would you recommend for a beginner doing C programming possibly one which would work with Windows Vista and does syntax highlighting?
2
by: downtownjelly | last post by:
i have a program in Bloodshed DevC++ and, when i use system("start c://program"); it works, it just makes an ugly console window appear for 1-3 seconds is there a way to hide or "suppress" that
17
by: cirfu | last post by:
is there an IDE for python of the same quality as Eclipse or DEVC++? I am currently using the editor that coems iwth python and it is all fine but for bigger projects it would be nice to have...
9
by: Jim Langston | last post by:
Does anyone know of a newsgroup appropriate for discussing DevC++? I looked for a Dev C++ newsgroup and mingw newsgroup but couldn't find one. -- Jim Langston tazmaster@rocketmail.com
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.