a console application in C++

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • arnuld

    #1

    a console application in C++

    i want to create a console application in C++ . what can be the 1st
    step ?

    NOTE: i did use Google but that gives me some VC++ based links using
    non-standard libraries.

  • Jim Langston

    #2
    Re: a console application in C++

    "arnuld" <geek.arnuld@gm ail.comwrote in message
    news:1184573033 .769963.262730@ m37g2000prh.goo glegroups.com.. .
    >i want to create a console application in C++ . what can be the 1st
    step ?
    >
    NOTE: i did use Google but that gives me some VC++ based links using
    non-standard libraries.
    Download a compiler.


    Comment

    • arnuld

      #3
      Re: a console application in C++

      On Jul 16, 1:34 pm, "Jim Langston" <tazmas...@rock etmail.comwrote :
      "arnuld" <geek.arn...@gm ail.comwrote in message
      i want to create a console application in C++ . what can be the 1st
      step ?
      NOTE: i did use Google but that gives me some VC++ based links using
      non-standard libraries.
      Download a compiler.

      seems like you did like my question. may be it is OT but i wanted to
      write a console application in C++ without using any non-standard
      libraries. i already have the compiler as i have Arch GNU/Linux: GCC
      4.2.1

      Comment

      • arnuld

        #4
        Re: a console application in C++

        On Jul 16, 2:07 pm, arnuld <geek.arn...@gm ail.comwrote:
        seems like you did like my question. may be it is OT but i wanted to
        write a console application in C++ without using any non-standard
        libraries. i already have the compiler as i have Arch GNU/Linux: GCC
        4.2.1
        i meant: "seems like you did NOT like my question. may be it is OT
        but i am not sure it is OT."

        Comment

        • =?ISO-8859-1?Q?Erik_Wikstr=F6m?=

          #5
          Re: a console application in C++

          On 2007-07-16 10:03, arnuld wrote:
          i want to create a console application in C++ . what can be the 1st
          step ?
          >
          NOTE: i did use Google but that gives me some VC++ based links using
          non-standard libraries.
          What do you mean by console application? Roughly speaking there are two
          kinds of applications, console and GUI and I don't think you've written
          any GUI applications yet, which means that what you've done so far are
          console applications.

          If the input/output capabilities of cin/cout are not enough for your
          needs you'll have to use some other, platform specific libraries since
          there's nothing more advanced in standard C++. If this is what you want
          ncurses might be worth looking into.

          --
          Erik Wikström

          Comment

          • Lionel B

            #6
            Re: a console application in C++

            On Mon, 16 Jul 2007 09:07:59 +0000, arnuld wrote:
            >On Jul 16, 1:34 pm, "Jim Langston" <tazmas...@rock etmail.comwrote :
            >"arnuld" <geek.arn...@gm ail.comwrote in message
            >
            >i want to create a console application in C++ . what can be the 1st
            step ?
            >
            NOTE: i did use Google but that gives me some VC++ based links using
            non-standard libraries.
            >
            >Download a compiler.
            >
            >
            seems like you did like my question. may be it is OT but i wanted to
            write a console application in C++ without using any non-standard
            libraries. i already have the compiler as i have Arch GNU/Linux: GCC
            4.2.1
            What is your definition of "console application"? Is this a "console
            application"? In a shell, do:

            $ cat hello.cpp
            #include <iostream>

            int main()
            {
            std::cout << "Hello world" << std::endl;
            }

            $ g++ -std=c++98 -pedantic hello.cpp -o hello
            $ ./hello
            Hello world

            Note: the "-std=c++98 -pedantic" flags ensure that you are compiling
            according to the current C++ standard without any GCC-specific extensions/
            restrictions to the language.

            --
            Lionel B

            Comment

            • arnuld

              #7
              Re: a console application in C++

              On Jul 16, 2:40 pm, Erik Wikström <Erik-wikst...@telia. comwrote:
              On 2007-07-16 10:03, arnuld wrote:
              >
              i want to create a console application in C++ . what can be the 1st
              step ?
              >
              NOTE: i did use Google but that gives me some VC++ based links using
              non-standard libraries.
              >
              What do you mean by console application? Roughly speaking there are two
              kinds of applications, console and GUI and I don't think you've written
              any GUI applications yet, which means that what you've done so far are
              console applications.
              >
              If the input/output capabilities of cin/cout are not enough for your
              needs you'll have to use some other, platform specific libraries since
              there's nothing more advanced in standard C++. If this is what you want
              ncurses might be worth looking into.
              sorry , i was at fault of not being clear. actually what we see at our
              colleges/universities is theoretical foundation like make a programme
              do this and do that. an average student from an average university
              (unlike MIT, CMU etc) reads books and does the things and when he
              enters in to the real-life software work like doing a job in industry
              or working directly with customers, he gets shock at first because it
              is *different*. same happened with me.

              i want to create some console programme, i mean, anything that can be
              called practical work and but which is general and approachable enough
              for a fresher like me..

              any ideas on that ?

              Comment

              • arnuld

                #8
                Re: a console application in C++

                On Jul 16, 2:50 pm, Lionel B <m...@privacy.n etwrote:
                $ g++ -std=c++98 -pedantic hello.cpp -o hello
                $ ./hello
                Hello world
                >
                Note: the "-std=c++98 -pedantic" flags ensure that you are compiling
                according to the current C++ standard without any GCC-specific extensions/
                restrictions to the language.

                Lionel, i use this.

                g++ -ansi -pedantic -Wall -Wextra file.cpp

                tell me if it is ok ?


                Comment

                • asterisc

                  #9
                  Re: a console application in C++

                  On Jul 16, 2:20 pm, arnuld <geek.arn...@gm ail.comwrote:
                  On Jul 16, 2:50 pm, Lionel B <m...@privacy.n etwrote:
                  $ g++ -std=c++98 -pedantic hello.cpp -o hello
                  $ ./hello
                  Hello world
                  >
                  Note: the "-std=c++98 -pedantic" flags ensure that you are compiling
                  according to the current C++ standard without any GCC-specific extensions/
                  restrictions to the language.
                  >
                  Lionel, i use this.
                  >
                  g++ -ansi -pedantic -Wall -Wextra file.cpp
                  >
                  tell me if it is ok ?
                  if you get the binary than is ok. On the other hand, if you are using
                  *nix based OS, man gcc or man g++ may help.

                  Comment

                  • Lionel B

                    #10
                    Re: a console application in C++

                    On Mon, 16 Jul 2007 11:20:30 +0000, arnuld wrote:
                    >On Jul 16, 2:50 pm, Lionel B <m...@privacy.n etwrote:
                    >
                    >$ g++ -std=c++98 -pedantic hello.cpp -o hello $ ./hello
                    >Hello world
                    >>
                    >Note: the "-std=c++98 -pedantic" flags ensure that you are compiling
                    >according to the current C++ standard without any GCC-specific
                    >extensions/ restrictions to the language.
                    >
                    >
                    Lionel, i use this.
                    >
                    g++ -ansi -pedantic -Wall -Wextra file.cpp
                    >
                    tell me if it is ok ?
                    I used to use -ansi rather than -std=c++98 until it was pointed out to me
                    (on this ng) that -std=c++98 is probably more appropriate; ISO is an
                    international standardisation organisation, while ANSI is US only.

                    Apart from which I've actually just had a look at the GCC manual and it
                    doesn't say what -ansi does (if anything) for C++ - it only specifies the
                    ISO 1990 C standard, apparently...

                    --
                    Lionel B

                    Comment

                    • Puppet_Sock

                      #11
                      Re: a console application in C++

                      On Jul 16, 4:03 am, arnuld <geek.arn...@gm ail.comwrote:
                      i want to create a console application in C++ . what can be the 1st
                      step ?
                      You need a compiler, linker, and the standard libraries.

                      You need some kind of ability to produce a source file.
                      That can be any convenient text editor that lets you
                      make a text file that your compiler can accept.

                      But this is off topic here. You need specifics on
                      how to run your local program, platform, compiler, etc.
                      If you have *language* questions, ask away. But how to
                      get your compiler etc. to produce an executable is off
                      topic here.

                      Look for help files or other docs with your compiler.
                      Look for news groups that have your compiler's name
                      in their name. Google for tutorials specific to your
                      particular compiler and platform.
                      Socks

                      Comment

                      • Default User

                        #12
                        Re: a console application in C++

                        Lionel B wrote:

                        I used to use -ansi rather than -std=c++98 until it was pointed out
                        to me (on this ng) that -std=c++98 is probably more appropriate; ISO
                        is an international standardisation organisation, while ANSI is US
                        only.
                        >
                        Apart from which I've actually just had a look at the GCC manual and
                        it doesn't say what -ansi does (if anything) for C++ - it only
                        specifies the ISO 1990 C standard, apparently...
                        From the Solaris man pages:

                        -ansi
                        In C mode, support all ISO C90 programs. In C++ mode,
                        remove GNU extensions that conflict with ISO C++.



                        Brian

                        Comment

                        • jjds101@yahoo.com

                          #13
                          Re: a console application in C++

                          On Jul 16, 7:19 am, arnuld <geek.arn...@gm ail.comwrote:
                          On Jul 16, 2:40 pm, Erik Wikström <Erik-wikst...@telia. comwrote:
                          >
                          >
                          >
                          On 2007-07-16 10:03, arnuld wrote:
                          >
                          i want to create a console application in C++ . what can be the 1st
                          step ?
                          >
                          NOTE: i did use Google but that gives me some VC++ based links using
                          non-standard libraries.
                          >
                          What do you mean by console application? Roughly speaking there are two
                          kinds of applications, console and GUI and I don't think you've written
                          any GUI applications yet, which means that what you've done so far are
                          console applications.
                          >
                          If the input/output capabilities of cin/cout are not enough for your
                          needs you'll have to use some other, platform specific libraries since
                          there's nothing more advanced in standard C++. If this is what you want
                          ncurses might be worth looking into.
                          >
                          sorry , i was at fault of not being clear. actually what we see at our
                          colleges/universities is theoretical foundation like make a programme
                          do this and do that. an average student from an average university
                          (unlike MIT, CMU etc) reads books and does the things and when he
                          enters in to the real-life software work like doing a job in industry
                          or working directly with customers, he gets shock at first because it
                          is *different*. same happened with me.
                          >
                          What the hell are you on about? This comes off like the rantings of a
                          madman
                          i want to create some console programme, i mean, anything that can be
                          called practical work and but which is general and approachable enough
                          for a fresher like me..
                          >
                          any ideas on that ?
                          Sure. The first is that you aren't going to get anywhere writing
                          vague and incomprehensibl e questions in a newsgroup. If you want to
                          write a program then write one. Do the exercises in a textbook.
                          Solve a problem. Or, if you're beyond more trivial matters and yearn
                          for something more like real-world experience, find an open source
                          project. There are plenty of places where open source apps can be
                          found. Start with a smaller one, and get familiar with the code --
                          add a feature, fix a bug, whatever.

                          Comment

                          • arnuld

                            #14
                            Re: a console application in C++

                            On Jul 16, 11:05 pm, jjds...@yahoo.c om wrote:
                            On Jul 16, 7:19 am, arnuld <geek.arn...@gm ail.comwrote:
                            >
                            >
                            >
                            On Jul 16, 2:40 pm, Erik Wikström <Erik-wikst...@telia. comwrote:
                            >
                            On 2007-07-16 10:03, arnuld wrote:
                            >
                            i want to create a console application in C++ . what can be the 1st
                            step ?
                            >
                            NOTE: i did use Google but that gives me some VC++ based links using
                            non-standard libraries.
                            >
                            What do you mean by console application? Roughly speaking there are two
                            kinds of applications, console and GUI and I don't think you've written
                            any GUI applications yet, which means that what you've done so far are
                            console applications.
                            >
                            If the input/output capabilities of cin/cout are not enough for your
                            needs you'll have to use some other, platform specific libraries since
                            there's nothing more advanced in standard C++. If this is what you want
                            ncurses might be worth looking into.
                            >
                            sorry , i was at fault of not being clear. actually what we see at our
                            colleges/universities is theoretical foundation like make a programme
                            do this and do that. an average student from an average university
                            (unlike MIT, CMU etc) reads books and does the things and when he
                            enters in to the real-life software work like doing a job in industry
                            or working directly with customers, he gets shock at first because it
                            is *different*. same happened with me.
                            >
                            What the hell are you on about? This comes off like the rantings of a
                            madman
                            >
                            i want to create some console programme, i mean, anything that can be
                            called practical work and but which is general and approachable enough
                            for a fresher like me..
                            >
                            any ideas on that ?
                            >
                            Sure. The first is that you aren't going to get anywhere writing
                            vague and incomprehensibl e questions in a newsgroup. If you want to
                            write a program then write one. Do the exercises in a textbook.
                            Solve a problem. Or, if you're beyond more trivial matters and yearn
                            for something more like real-world experience, find an open source
                            project. There are plenty of places where open source apps can be
                            found. Start with a smaller one, and get familiar with the code --
                            add a feature, fix a bug, whatever.
                            TROLL alert....

                            *PLONK*

                            Comment

                            • Kai-Uwe Bux

                              #15
                              Re: a console application in C++

                              arnuld wrote:
                              i want to create a console application in C++ . what can be the 1st
                              step ?
                              Find a problem that your program should solve. Without a problem, it is hard
                              to tell whether the program is correct/useful.
                              NOTE: i did use Google but that gives me some VC++ based links using
                              non-standard libraries.
                              Which libraries you will need is something to be determined once you know
                              what you want the program to do.


                              Best

                              Kai-Uwe Bux

                              Comment

                              Working...