473,624 Members | 2,601 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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\defau lt
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 1632
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.co mwrote:
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...@gmai l.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.co mwrote:
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...@gmai l.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.co mwrote:
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...@gmai l.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...@gmai l.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.co mwrote:
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...@gmai l.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...@gmai l.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.co mwrote:
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...@gmai l.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...@gmai l.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.co mwrote:
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...@gmai l.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...@gmai l.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...@gmai l.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.co mwrote:
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\defau lt
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

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

Similar topics

5
1283
by: Eduardo Elgueta | last post by:
Hi All, Would anyone be so kind to explain this? -- begin -- >>> (176L,) > 300 True --end-- (Python2.3)
0
916
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", "xpath navigators" and the list goes on. Yesterday I thought myself in a court room, the compiler was complaining about the xml evidence, and I didn't have any, I was trying to tell him "I swear, it is xml, believe me" Well, anyway, I...
11
1703
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 a lot of converting '__gc' to 'ref', converting '*' to '^', converting 'new' to 'gcnew'. Of course this can't be done with a blanket replace, as my code has both managed and unmanaged segments. Thus I have to do them one-by-one. Also, things are...
9
3065
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 System.Threading.ThreadInterruptedException System.Threading.ThreadStateException to see if I could get more information about why the thread stops running but that code is never executed. Any ideas on how I can debug this?
5
1037
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 Threading.Thread(AddressOf cTrdImportThread_Callback)
0
1200
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 problem isolating individual fields in a FormView. I am trying to manually add some values to a Dropdownlist in the EditMode of the Formview. I have a serious of dropdownlists in the formview that are populated from
2
1726
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 didn't seem to help. I had stopped the Office Source Engine from running at startup and thought that might be it so I started that again. I did these in this order (repaired, then started Office Source Engine.) Any ideas why this may be...
2
921
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
1229
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
8179
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8685
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8633
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8348
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8493
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6112
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4084
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4187
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2613
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.