Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > a console application in C++

Reply
Thread Tools

a console application in C++

 
 
arnuld
Guest
Posts: n/a
 
      07-16-2007
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.

 
Reply With Quote
 
 
 
 
Jim Langston
Guest
Posts: n/a
 
      07-16-2007
"arnuld" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.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.


 
Reply With Quote
 
 
 
 
arnuld
Guest
Posts: n/a
 
      07-16-2007
> On Jul 16, 1:34 pm, "Jim Langston" <(E-Mail Removed)> wrote:
> "arnuld" <(E-Mail Removed)> wrote 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

 
Reply With Quote
 
arnuld
Guest
Posts: n/a
 
      07-16-2007
> On Jul 16, 2:07 pm, arnuld <(E-Mail Removed)> wrote:

> 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."

 
Reply With Quote
 
=?ISO-8859-1?Q?Erik_Wikstr=F6m?=
Guest
Posts: n/a
 
      07-16-2007
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
 
Reply With Quote
 
Lionel B
Guest
Posts: n/a
 
      07-16-2007
On Mon, 16 Jul 2007 09:07:59 +0000, arnuld wrote:

>> On Jul 16, 1:34 pm, "Jim Langston" <(E-Mail Removed)> wrote:
>> "arnuld" <(E-Mail Removed)> wrote 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
 
Reply With Quote
 
arnuld
Guest
Posts: n/a
 
      07-16-2007
On Jul 16, 2:40 pm, Erik Wikström <(E-Mail Removed)> wrote:
> 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 ?

 
Reply With Quote
 
arnuld
Guest
Posts: n/a
 
      07-16-2007
> On Jul 16, 2:50 pm, Lionel B <(E-Mail Removed)> wrote:

> $ 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 ?


 
Reply With Quote
 
asterisc
Guest
Posts: n/a
 
      07-16-2007
On Jul 16, 2:20 pm, arnuld <(E-Mail Removed)> wrote:
> > On Jul 16, 2:50 pm, Lionel B <(E-Mail Removed)> wrote:
> > $ 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.

 
Reply With Quote
 
Lionel B
Guest
Posts: n/a
 
      07-16-2007
On Mon, 16 Jul 2007 11:20:30 +0000, arnuld wrote:

>> On Jul 16, 2:50 pm, Lionel B <(E-Mail Removed)> wrote:

>
>> $ 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
 
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
Starting a GUI application out of an console application Fabian Steiner Python 1 07-17-2006 05:01 PM
A simple Console Application to ASP.NET application Web learner ASP .Net 1 01-27-2006 03:09 AM
How to start ASP.Net application from console application? Mike ASP .Net 9 11-30-2005 12:26 AM
Re: console mp3->wav decoder for $indows or GUI one which supports console Egor Bolonev Python 0 06-30-2003 10:43 AM
Re: console mp3->wav decoder for $indows or GUI one which supports console Ben Finney Python 2 06-30-2003 05:43 AM



Advertisments