just started

Discussion in 'C++' started by sterling.mckay@gmail.com, Jan 28, 2007.

  1. Guest

    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, 2007
    #1
    1. Advertising

  2. Ian Collins Guest

    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.
    Ian Collins, Jan 28, 2007
    #2
    1. Advertising

  3. LoKi Guest

    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 <> wrote:
    > 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.
    LoKi, Jan 28, 2007
    #3
  4. Guest

    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" <> 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 <> wrote:
    >
    > > 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, 2007
    #4
  5. LoKi Guest

    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, 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" <> 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 <> wrote:

    >
    > > > 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.
    LoKi, Jan 28, 2007
    #5
  6. Guest

    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" <> 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, 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" <> 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 <> wrote:

    >
    > > > > 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, 2007
    #6
  7. LoKi Guest

    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, 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" <> 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, 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" <> 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 <> wrote:

    >
    > > > > > 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.
    LoKi, Jan 28, 2007
    #7
  8. LoKi Guest

    (scroll down on the page I sent you, you will find the download link)

    On Jan 28, 12:32 am, 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" <> 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, 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" <> 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 <> wrote:

    >
    > > > > > 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.
    LoKi, Jan 28, 2007
    #8
  9. Guest

    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" <> wrote:
    > (scroll down on the page I sent you, you will find the download link)
    >
    > On Jan 28, 12:32 am, 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" <> 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, 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" <> 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 <> wrote:

    >
    > > > > > > 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, 2007
    #9
  10. * :
    > 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?
    Alf P. Steinbach, Jan 28, 2007
    #10
  11. Guest

    , Jan 28, 2007
    #11
  12. Daniel T. Guest

    Daniel T., Jan 28, 2007
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dave

    Just getting started

    Dave, Aug 8, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    399
  2. abillmeier

    Just getting started

    abillmeier, Mar 7, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    388
    abillmeier
    Mar 7, 2006
  3. Eric
    Replies:
    8
    Views:
    425
    Alf P. Steinbach
    Feb 2, 2005
  4. W. Watson
    Replies:
    18
    Views:
    559
    Jussi Salmela
    Jan 8, 2007
  5. Jake Barnes
    Replies:
    2
    Views:
    307
Loading...

Share This Page