473,379 Members | 1,201 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,379 software developers and data experts.

Hello world disappearing console

Alright - I've been using VS .NET for all of 3 hours now - so pardon
the stupidity of my question.

Can someone walk me through a simple hello world that outputs to
console, in terms of which project, what settings to change etc. Or
point me to a getting starting using VC++ guide that explains the
projects and relevant settings.

My background is in Java, and the environment is totally different -
but I think I want to move towards C, C++, C# and this is the
beginning.

The C code is as follows.

#include <stdio.h>

int main(void)
{
printf("Hello World");
return 0;
}

Very simple and very stupid.

First problem it gave me was regarding preprocess precompiled
something.

Now it runs the program but the console just vanishes after a split
second. If I put it into an infinite loop the console is available.
My question is - how do I get it to display the console normally -
meaning at the bottom of the screen that shows the compiling and
linking etc. (kinda like the console in Jbuilder, or is this not
possible).

And if this is not possible, then can I have the command prompt window
actually stay there instead of vanishing in the blink of an eye.
Finally links to good resources for those of us just starting out in
this world, perhaps book recommendations, or forums, websites, faqs,
WHATEVER.

Thanks very much in advance
Tarique
Nov 16 '05 #1
1 1559
Hi,

There is nothing wrong with ur program. The console window is vanishing as
there is no message pump in ur program. u can make it stay by giving the
following statements

printf("press any key to continue...");
getchar();
return 0;

getchar() waits for an character input from the keyboard and once it gets
the input moves to the next statement.

Regarding resources The following might be of help to u.
http://www.codeproject.com
http://www.codeguru.com
http://www.winprog.org/tutorial/ (win32 tutorial)

Girish.
"Tarique Jawed" <tj*******@hotmail.com> wrote in message
news:33**************************@posting.google.c om...
Alright - I've been using VS .NET for all of 3 hours now - so pardon
the stupidity of my question.

Can someone walk me through a simple hello world that outputs to
console, in terms of which project, what settings to change etc. Or
point me to a getting starting using VC++ guide that explains the
projects and relevant settings.

My background is in Java, and the environment is totally different -
but I think I want to move towards C, C++, C# and this is the
beginning.

The C code is as follows.

#include <stdio.h>

int main(void)
{
printf("Hello World");
return 0;
}

Very simple and very stupid.

First problem it gave me was regarding preprocess precompiled
something.

Now it runs the program but the console just vanishes after a split
second. If I put it into an infinite loop the console is available.
My question is - how do I get it to display the console normally -
meaning at the bottom of the screen that shows the compiling and
linking etc. (kinda like the console in Jbuilder, or is this not
possible).

And if this is not possible, then can I have the command prompt window
actually stay there instead of vanishing in the blink of an eye.
Finally links to good resources for those of us just starting out in
this world, perhaps book recommendations, or forums, websites, faqs,
WHATEVER.

Thanks very much in advance
Tarique

Nov 16 '05 #2

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

Similar topics

3
by: Matthew K Jensen | last post by:
In another one of my silly apps, I'm using 'windows=' in the setup script. I can't get the darn console window do disappear. Since the said app is going to be used with people that have...
24
by: Andy Sutorius | last post by:
Has anyone successfully created a Hello World program without using Visual Studio.NET? If so, what IDE did you use and what namespaces did you import? Thanks! Andy Sutorius
17
by: Tim Judd | last post by:
I must not be grasping anything here. Just a simple application, as follows (as any first-program is...) ---- #include <iostream.h> int main() { cout <<"hello world"; return 0;
3
by: Harry Keck | last post by:
I am trying to create an xsl stylesheet on the fly as an xml document. I create elements of type "xsl:value-of" and insert them into my document, but when I output the xml representation of the...
5
by: surena abari | last post by:
Hi, When writing the hello world program I insert \b in various locations in the sentence.It works(making backspace) except when inserting it after world\b.It dose not work. Printf("hello,...
4
by: Andy Sutorius | last post by:
Has anyone successfully created a VB.NET Hello World program without using Visual Studio.NET? If so, what IDE did you use and what namespaces did you import? Thanks! Andy Sutorius
2
by: Tony Johansson | last post by:
Hello! Here I have a very easy hello world example. This example works fine. I just wonder how can it work when I have private on the Main method. I would think that the operating system would...
11
by: Hello | last post by:
Hi every one. The famous Hello code below written by C++. through its mother program "Visual studio 2005" When I make copy to all files of this program and click on .EXE file away from the...
2
Curtis Rutland
by: Curtis Rutland | last post by:
I have been informed that today is Hello World Day, so in honor of that, I'd just like to say: static void Main(string args) { int hwRevInt = { 33, 100, 108, 114, 111, 87, 32, 111, 108, 108,...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.