Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > just started

Reply
Thread Tools

just started

 
 
sterling.mckay@gmail.com
Guest
Posts: n/a
 
      01-28-2007
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 ? !

 
Reply With Quote
 
 
 
 
Ian Collins
Guest
Posts: n/a
 
      01-28-2007
http://www.velocityreviews.com/forums/(E-Mail Removed) 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.
 
Reply With Quote
 
 
 
 
LoKi
Guest
Posts: n/a
 
      01-28-2007
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 <(E-Mail Removed)> wrote:
> (E-Mail Removed) 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.


 
Reply With Quote
 
sterling.mckay@gmail.com
Guest
Posts: n/a
 
      01-28-2007
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" <(E-Mail Removed)> wrote:
> 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 <(E-Mail Removed)> wrote:
>
> > (E-Mail Removed) 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.


 
Reply With Quote
 
LoKi
Guest
Posts: n/a
 
      01-28-2007
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, (E-Mail Removed) 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" <(E-Mail Removed)> wrote:
>
> > 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 <(E-Mail Removed)> wrote:

>
> > > (E-Mail Removed) 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.


 
Reply With Quote
 
sterling.mckay@gmail.com
Guest
Posts: n/a
 
      01-28-2007
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" <(E-Mail Removed)> wrote:
> 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, (E-Mail Removed) 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" <(E-Mail Removed)> wrote:

>
> > > 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 <(E-Mail Removed)> wrote:

>
> > > > (E-Mail Removed) 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.


 
Reply With Quote
 
LoKi
Guest
Posts: n/a
 
      01-28-2007
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, (E-Mail Removed) 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" <(E-Mail Removed)> wrote:
>
> > 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, (E-Mail Removed) 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" <(E-Mail Removed)> wrote:

>
> > > > 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 <(E-Mail Removed)> wrote:

>
> > > > > (E-Mail Removed) 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.


 
Reply With Quote
 
LoKi
Guest
Posts: n/a
 
      01-28-2007
(scroll down on the page I sent you, you will find the download link)

On Jan 28, 12:32 am, (E-Mail Removed) 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" <(E-Mail Removed)> wrote:
>
> > 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, (E-Mail Removed) 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" <(E-Mail Removed)> wrote:

>
> > > > 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 <(E-Mail Removed)> wrote:

>
> > > > > (E-Mail Removed) 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.


 
Reply With Quote
 
sterling.mckay@gmail.com
Guest
Posts: n/a
 
      01-28-2007
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" <(E-Mail Removed)> wrote:
> (scroll down on the page I sent you, you will find the download link)
>
> On Jan 28, 12:32 am, (E-Mail Removed) 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" <(E-Mail Removed)> wrote:

>
> > > 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, (E-Mail Removed) 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" <(E-Mail Removed)> wrote:

>
> > > > > 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 <(E-Mail Removed)> wrote:

>
> > > > > > (E-Mail Removed) 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.


 
Reply With Quote
 
Alf P. Steinbach
Guest
Posts: n/a
 
      01-28-2007
* (E-Mail Removed):
> 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?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
if a variable is started inside a closure, can it ever be redeclared and started over, outside of the original function? Jake Barnes Javascript 2 02-15-2006 03:32 AM
just started European Bob MCSE 5 01-05-2004 02:48 AM
Just started Andy MCSE 47 08-07-2003 03:16 PM
Just getting started looking into certifications... Marko MCSE 2 07-15-2003 03:19 PM
Re: Just getting started looking into certifications... Lady MCSE 2 07-15-2003 01:33 PM



Advertisments