473,325 Members | 2,712 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,325 software developers and data experts.

just started

Just started to teach myself C C++ programming... I have been very
interested with computers for a while now and have a nac or so I
thought for how they work ... hardware I am ok with ... I can
understand and tear it down and rebuild it ... chips boards I/O etc
etc ... programing is a different beast ...

So I am fooling around with C and compile a small .exe file with
Miracle C ... simple thing that said Hi my name is etc etc ... but I
noticed that it loads in a dos window ... Why doesn't it load in
a .txt file ? My main question is this ... after you run the test.exe
it flashes open the DOS window and closes quickly ... now this I
understand ... I do have my MCE and I am trained in Windows XP tech
support ... I know that a "close on exit" command is "checked" for the
application and I know to just open the default properties and de-
select the check box ...

My question is this ... is there a way in C or C++ to write this into
the test.exe I made that simply shows "my name is .... "

This is where I am a total newb and have no idea where to go ... I
don't see any reference to a switch or execute in any of the library
files ... the stdio.h or stdlib.h ... i don't see where i can say

the directory is C:\windir
the program is C:\windir\default
the program has a properties tab
the properties tab has Misc, etc etc ...
the misc tab has an option for "close on exit"
the "close on exit" should be false

I have no idea really ... i don't even know if it possible ... maybe
it's better to just reg hack it and save the batch file ...

Any ideas ? or I am way the hell off base ? :) !

Jan 28 '07 #1
11 1612
st************@gmail.com wrote:
>
So I am fooling around with C and compile a small .exe file with
Miracle C ... simple thing that said Hi my name is etc etc ... but I
noticed that it loads in a dos window ... Why doesn't it load in
a .txt file ? My main question is this ... after you run the test.exe
it flashes open the DOS window and closes quickly ... now this I
understand ... I do have my MCE and I am trained in Windows XP tech
support ... I know that a "close on exit" command is "checked" for the
application and I know to just open the default properties and de-
select the check box ...
Looks like you'd be better of posting to a windows programming group, or
one for your compiler.

--
Ian Collins.
Jan 28 '07 #2
The simplest way to keep the DOS window from closing automatically is
to use the following command:

system("pause");

place this command just before the return 0; in your main function.
this will issue a pause command to the terminal and will wait until
input to continue.
(I'm not sure i fully understand your questions...so I apologize if
this is completely off topic.)

On Jan 27, 11:48 pm, Ian Collins <ian-n...@hotmail.comwrote:
sterling.mc...@gmail.com wrote:
So I am fooling around with C and compile a small .exe file with
Miracle C ... simple thing that said Hi my name is etc etc ... but I
noticed that it loads in a dos window ... Why doesn't it load in
a .txt file ? My main question is this ... after you run the test.exe
it flashes open the DOS window and closes quickly ... now this I
understand ... I do have my MCE and I am trained in Windows XP tech
support ... I know that a "close on exit" command is "checked" for the
application and I know to just open the default properties and de-
select the check box ...Looks like you'd be better of posting to a windows programming group, or
one for your compiler.

--
Ian Collins.
Jan 28 '07 #3
lol I am not sure I fully understand the questions either :)
I am curious about programming and wanted to see what and where to
start ... so I got some info on C C++ and then made a simple file ...
set some varibles etc ...

but when I noticed that the dos window open and closed instantly I was
again just curious ... I mean in windows all I had to do was go to c:
\windir\default and choose the properties and deselect the check box
to close on exit ... and then started to wonder if I could incorperate
this into the script with C C++ commands ...

maybe I need to look into Visual C++ to interact with Windows ...
again I am not sure just curious is all
On Jan 28, 1:07 am, "LoKi" <neilgr...@gmail.comwrote:
The simplest way to keep the DOS window from closing automatically is
to use the following command:

system("pause");

place this command just before the return 0; in your main function.

this will issue a pause command to the terminal and will wait until
input to continue.
(I'm not sure i fully understand your questions...so I apologize if
this is completely off topic.)

On Jan 27, 11:48 pm, Ian Collins <ian-n...@hotmail.comwrote:
sterling.mc...@gmail.com wrote:
So I am fooling around with C and compile a small .exe file with
Miracle C ... simple thing that said Hi my name is etc etc ... but I
noticed that it loads in a dos window ... Why doesn't it load in
a .txt file ? My main question is this ... after you run the test.exe
it flashes open the DOS window and closes quickly ... now this I
understand ... I do have my MCE and I am trained in Windows XP tech
support ... I know that a "close on exit" command is "checked" for the
application and I know to just open the default properties and de-
select the check box ...Looks like you'd be better of posting to a windows programming group, or
one for your compiler.
--
Ian Collins.
Jan 28 '07 #4
try running this code:
#include <iostream>
using namespace std;

int main()
{
cout << "Hi my name is John Doe" << endl;

cout << '\n';
system("pause"); //this command is used to pause the terminal window
return 0;
}

On Jan 28, 12:18 am, sterling.mc...@gmail.com wrote:
lol I am not sure I fully understand the questions either :)
I am curious about programming and wanted to see what and where to
start ... so I got some info on C C++ and then made a simple file ...
set some varibles etc ...

but when I noticed that the dos window open and closed instantly I was
again just curious ... I mean in windows all I had to do was go to c:
\windir\default and choose the properties and deselect the check box
to close on exit ... and then started to wonder if I could incorperate
this into the script with C C++ commands ...

maybe I need to look into Visual C++ to interact with Windows ...
again I am not sure just curious is all

On Jan 28, 1:07 am, "LoKi" <neilgr...@gmail.comwrote:
The simplest way to keep the DOS window from closing automatically is
to use the following command:
system("pause");
place this command just before the return 0; in your main function.
this will issue a pause command to the terminal and will wait until
input to continue.
(I'm not sure i fully understand your questions...so I apologize if
this is completely off topic.)
On Jan 27, 11:48 pm, Ian Collins <ian-n...@hotmail.comwrote:
sterling.mc...@gmail.com wrote:
So I am fooling around with C and compile a small .exe file with
Miracle C ... simple thing that said Hi my name is etc etc ... but I
noticed that it loads in a dos window ... Why doesn't it load in
a .txt file ? My main question is this ... after you run the test.exe
it flashes open the DOS window and closes quickly ... now this I
understand ... I do have my MCE and I am trained in Windows XP tech
support ... I know that a "close on exit" command is "checked" for the
application and I know to just open the default properties and de-
select the check box ...Looks like you'd be better of posting to a windows programming group, or
one for your compiler.
--
Ian Collins.
Jan 28 '07 #5
Ok so ... please understand that I am completely new at this and I am
learning as I go ... I have read page after page but I learn when I am
testing stuff and actually doing/trying things out.

That code will not compile in the Miracle C application that I dl'ed
for testing ... so does that mean that I need a different compiler ?
if so what is a good one to start with ?

On Jan 28, 1:23 am, "LoKi" <neilgr...@gmail.comwrote:
try running this code:

#include <iostream>
using namespace std;

int main()
{
cout << "Hi my name is John Doe" << endl;

cout << '\n';
system("pause"); //this command is used to pause the terminal window
return 0;

}On Jan 28, 12:18 am, sterling.mc...@gmail.com wrote:
lol I am not sure I fully understand the questions either :)
I am curious about programming and wanted to see what and where to
start ... so I got some info on C C++ and then made a simple file ...
set some varibles etc ...
but when I noticed that the dos window open and closed instantly I was
again just curious ... I mean in windows all I had to do was go to c:
\windir\default and choose the properties and deselect the check box
to close on exit ... and then started to wonder if I could incorperate
this into the script with C C++ commands ...
maybe I need to look into Visual C++ to interact with Windows ...
again I am not sure just curious is all
On Jan 28, 1:07 am, "LoKi" <neilgr...@gmail.comwrote:
The simplest way to keep the DOS window from closing automatically is
to use the following command:
system("pause");
place this command just before the return 0; in your main function.
this will issue a pause command to the terminal and will wait until
input to continue.
(I'm not sure i fully understand your questions...so I apologize if
this is completely off topic.)
On Jan 27, 11:48 pm, Ian Collins <ian-n...@hotmail.comwrote:
sterling.mc...@gmail.com wrote:
So I am fooling around with C and compile a small .exe file with
Miracle C ... simple thing that said Hi my name is etc etc ... but I
noticed that it loads in a dos window ... Why doesn't it load in
a .txt file ? My main question is this ... after you run the test.exe
it flashes open the DOS window and closes quickly ... now this I
understand ... I do have my MCE and I am trained in Windows XP tech
support ... I know that a "close on exit" command is "checked" for the
application and I know to just open the default properties and de-
select the check box ...Looks like you'd be better of posting to a windows programming group, or
one for your compiler.
--
Ian Collins.
Jan 28 '07 #6
I would suggest getting a new complier/environment.

a group called bloodshed has made what they call dev C++.

Follow this link:
http://www.bloodshed.net/dev/devcpp.html

and be sure to download version 5 (this is still a beta version, but
very stable)

On Jan 28, 12:32 am, sterling.mc...@gmail.com wrote:
Ok so ... please understand that I am completely new at this and I am
learning as I go ... I have read page after page but I learn when I am
testing stuff and actually doing/trying things out.

That code will not compile in the Miracle C application that I dl'ed
for testing ... so does that mean that I need a different compiler ?
if so what is a good one to start with ?

On Jan 28, 1:23 am, "LoKi" <neilgr...@gmail.comwrote:
try running this code:
#include <iostream>
using namespace std;
int main()
{
cout << "Hi my name is John Doe" << endl;
cout << '\n';
system("pause"); //this command is used to pause the terminal window
return 0;
}On Jan 28, 12:18 am, sterling.mc...@gmail.com wrote:
lol I am not sure I fully understand the questions either :)
I am curious about programming and wanted to see what and where to
start ... so I got some info on C C++ and then made a simple file ...
set some varibles etc ...
but when I noticed that the dos window open and closed instantly I was
again just curious ... I mean in windows all I had to do was go to c:
\windir\default and choose the properties and deselect the check box
to close on exit ... and then started to wonder if I could incorperate
this into the script with C C++ commands ...
maybe I need to look into Visual C++ to interact with Windows ...
again I am not sure just curious is all
On Jan 28, 1:07 am, "LoKi" <neilgr...@gmail.comwrote:
The simplest way to keep the DOS window from closing automatically is
to use the following command:
system("pause");
place this command just before the return 0; in your main function.
this will issue a pause command to the terminal and will wait until
input to continue.
(I'm not sure i fully understand your questions...so I apologize if
this is completely off topic.)
On Jan 27, 11:48 pm, Ian Collins <ian-n...@hotmail.comwrote:
sterling.mc...@gmail.com wrote:
So I am fooling around with C and compile a small .exe file with
Miracle C ... simple thing that said Hi my name is etc etc ... but I
noticed that it loads in a dos window ... Why doesn't it load in
a .txt file ? My main question is this ... after you run the test.exe
it flashes open the DOS window and closes quickly ... now this I
understand ... I do have my MCE and I am trained in Windows XP tech
support ... I know that a "close on exit" command is "checked" for the
application and I know to just open the default properties and de-
select the check box ...Looks like you'd be better of posting to a windows programming group, or
one for your compiler.
--
Ian Collins.
Jan 28 '07 #7
(scroll down on the page I sent you, you will find the download link)

On Jan 28, 12:32 am, sterling.mc...@gmail.com wrote:
Ok so ... please understand that I am completely new at this and I am
learning as I go ... I have read page after page but I learn when I am
testing stuff and actually doing/trying things out.

That code will not compile in the Miracle C application that I dl'ed
for testing ... so does that mean that I need a different compiler ?
if so what is a good one to start with ?

On Jan 28, 1:23 am, "LoKi" <neilgr...@gmail.comwrote:
try running this code:
#include <iostream>
using namespace std;
int main()
{
cout << "Hi my name is John Doe" << endl;
cout << '\n';
system("pause"); //this command is used to pause the terminal window
return 0;
}On Jan 28, 12:18 am, sterling.mc...@gmail.com wrote:
lol I am not sure I fully understand the questions either :)
I am curious about programming and wanted to see what and where to
start ... so I got some info on C C++ and then made a simple file ...
set some varibles etc ...
but when I noticed that the dos window open and closed instantly I was
again just curious ... I mean in windows all I had to do was go to c:
\windir\default and choose the properties and deselect the check box
to close on exit ... and then started to wonder if I could incorperate
this into the script with C C++ commands ...
maybe I need to look into Visual C++ to interact with Windows ...
again I am not sure just curious is all
On Jan 28, 1:07 am, "LoKi" <neilgr...@gmail.comwrote:
The simplest way to keep the DOS window from closing automatically is
to use the following command:
system("pause");
place this command just before the return 0; in your main function.
this will issue a pause command to the terminal and will wait until
input to continue.
(I'm not sure i fully understand your questions...so I apologize if
this is completely off topic.)
On Jan 27, 11:48 pm, Ian Collins <ian-n...@hotmail.comwrote:
sterling.mc...@gmail.com wrote:
So I am fooling around with C and compile a small .exe file with
Miracle C ... simple thing that said Hi my name is etc etc ... but I
noticed that it loads in a dos window ... Why doesn't it load in
a .txt file ? My main question is this ... after you run the test.exe
it flashes open the DOS window and closes quickly ... now this I
understand ... I do have my MCE and I am trained in Windows XP tech
support ... I know that a "close on exit" command is "checked" for the
application and I know to just open the default properties and de-
select the check box ...Looks like you'd be better of posting to a windows programming group, or
one for your compiler.
--
Ian Collins.
Jan 28 '07 #8
nice ... thanks for the heads up on this compiler ... I'll do some
research on it and see what I can see :) Thanks again bro !! If you
have any fav news groups or sites with info that could help a new guy
out lemme know.

/salute

On Jan 28, 1:36 am, "LoKi" <neilgr...@gmail.comwrote:
(scroll down on the page I sent you, you will find the download link)

On Jan 28, 12:32 am, sterling.mc...@gmail.com wrote:
Ok so ... please understand that I am completely new at this and I am
learning as I go ... I have read page after page but I learn when I am
testing stuff and actually doing/trying things out.
That code will not compile in the Miracle C application that I dl'ed
for testing ... so does that mean that I need a different compiler ?
if so what is a good one to start with ?
On Jan 28, 1:23 am, "LoKi" <neilgr...@gmail.comwrote:
try running this code:
#include <iostream>
using namespace std;
int main()
{
cout << "Hi my name is John Doe" << endl;
cout << '\n';
system("pause"); //this command is used to pause the terminal window
return 0;
}On Jan 28, 12:18 am, sterling.mc...@gmail.com wrote:
lol I am not sure I fully understand the questions either :)
I am curious about programming and wanted to see what and where to
start ... so I got some info on C C++ and then made a simple file ...
set some varibles etc ...
but when I noticed that the dos window open and closed instantly I was
again just curious ... I mean in windows all I had to do was go to c:
\windir\default and choose the properties and deselect the check box
to close on exit ... and then started to wonder if I could incorperate
this into the script with C C++ commands ...
maybe I need to look into Visual C++ to interact with Windows ...
again I am not sure just curious is all
On Jan 28, 1:07 am, "LoKi" <neilgr...@gmail.comwrote:
The simplest way to keep the DOS window from closing automatically is
to use the following command:
system("pause");
place this command just before the return 0; in your main function.
this will issue a pause command to the terminal and will wait until
input to continue.
(I'm not sure i fully understand your questions...so I apologize if
this is completely off topic.)
On Jan 27, 11:48 pm, Ian Collins <ian-n...@hotmail.comwrote:
sterling.mc...@gmail.com wrote:
So I am fooling around with C and compile a small .exe file with
Miracle C ... simple thing that said Hi my name is etc etc ... but I
noticed that it loads in a dos window ... Why doesn't it load in
a .txt file ? My main question is this ... after you run the test.exe
it flashes open the DOS window and closes quickly ... now this I
understand ... I do have my MCE and I am trained in Windows XP tech
support ... I know that a "close on exit" command is "checked" for the
application and I know to just open the default properties and de-
select the check box ...Looks like you'd be better of posting to a windows programming group, or
one for your compiler.
--
Ian Collins.
Jan 28 '07 #9
* st************@gmail.com:
Just started to teach myself C C++ programming... I have been very
interested with computers for a while now and have a nac or so I
thought for how they work ... hardware I am ok with ... I can
understand and tear it down and rebuild it ... chips boards I/O etc
etc ... programing is a different beast ...

So I am fooling around with C and compile a small .exe file with
Miracle C ... simple thing that said Hi my name is etc etc ... but I
noticed that it loads in a dos window ... Why doesn't it load in
a .txt file ? My main question is this ... after you run the test.exe
it flashes open the DOS window and closes quickly ... now this I
understand ... I do have my MCE and I am trained in Windows XP tech
support ... I know that a "close on exit" command is "checked" for the
application and I know to just open the default properties and de-
select the check box ...

My question is this ... is there a way in C or C++ to write this into
the test.exe I made that simply shows "my name is .... "

This is where I am a total newb and have no idea where to go ... I
don't see any reference to a switch or execute in any of the library
files ... the stdio.h or stdlib.h ... i don't see where i can say

the directory is C:\windir
the program is C:\windir\default
the program has a properties tab
the properties tab has Misc, etc etc ...
the misc tab has an option for "close on exit"
the "close on exit" should be false

I have no idea really ... i don't even know if it possible ... maybe
it's better to just reg hack it and save the batch file ...

Any ideas ? or I am way the hell off base ? :) !
First, please don't top-post in this group, as you've done later in the
thread.

Your question really has nothing to do with C++. You'll get the same
effect no matter which language is used to create your executable. It's
purely a Windows issue.

Normally that would be off-topic, but this issue is so common that it
would be evil to send you somewhere else.

So: you can (1) use a command interpreter to run your program (there is
a primitive one shipped with Windows), (2) make a simple batch file to
run your program and pause, (3) use an Integrated Development
Environment that does the batch file thing for you automatically, (4)
make your program itself pause at the end, e.g. by reading a line from
standard input, or (5) use some other operating system than Windows.

The best option is (1), because you'll need to learn to use the computer
that way anyway, and the worst option, because it requires learning a
whole new operating system, is (5).

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jan 28 '07 #10
http://en.wikipedia.org/wiki/Top-posting

first I have heard of it ... my bad ...

Jan 28 '07 #11
st************@gmail.com wrote:
If you have any fav news groups or sites with info that could help a
new guy out lemme know.
http://www.parashift.com/c++-faq-lite/
http://www.dinkumware.com/refxcpp.html
http://www.trumphurst.com/cpplibs/cpplibs.phtml
Jan 28 '07 #12

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

Similar topics

5
by: Eduardo Elgueta | last post by:
Hi All, Would anyone be so kind to explain this? -- begin -- >>> (176L,) > 300 True --end-- (Python2.3)
0
by: G. Tarazi | last post by:
I just started using the xslt transformations using .net and C#, and now is the second day trying to figure out the new error messages, messages like "you are missing evidence" or "xml resolvers",...
11
by: Peter Oliphant | last post by:
I've been trying all morning to convert my 2003 project (managed) to 2005 (/clr since I have both managed and unmanaged code). I'm guessing I have tens of thousands of lines of code to change. Did...
9
by: mareal | last post by:
I have noticed how the thread I created just stops running. I have added several exceptions to the thread System.Threading.SynchronizationLockException System.Threading.ThreadAbortException...
5
by: Nick | last post by:
Hi there, This one is really doing my head in, I am attempting to start a thread using the following code, -------------------- Public Sub start() cTrdImportThread = New...
0
by: abillmeier | last post by:
I am just getting started messing with ASP 2.0, and am working on creating a quick data entry web hooked to a SQL database. I am using stored procedures to get and push data. I am having a...
2
by: veaux | last post by:
When I try to use the Link Table and select the type "ODBC" the browse window just disappears. If I select any other type, it behaves correctly. I tried repairing my office installation, but that...
2
by: pk4u1432003 | last post by:
I HAve Just Started Using C# And Am Having Peroblems Understanding THe Flow Of The Program Could Anyone Help Me Out In Wha IS To Be Concentrated On While Preparing A Console App In C#
3
by: adess | last post by:
Hi all Am adess, just started my bachelor degree in software engineering in Mauritius. Would like to seek help on sites that i could consult for tutorials. thanks adess
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.