public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Oscar Fuentes <ofv@wanadoo.es>
To: faisal gillani <fasi_74@yahoo.com>
Cc: gcc-help@gcc.gnu.org
Subject: Re: newbie of c++ in linux
Date: Fri, 28 Jun 2002 18:47:00 -0000	[thread overview]
Message-ID: <wusiq2j5.fsf@wanadoo.es> (raw)
In-Reply-To: <20020629011550.68843.qmail@web11003.mail.yahoo.com>

faisal gillani <fasi_74@yahoo.com> writes:

> Well i am a newbie learning c++ these days we are
> being thaught on turbo c 3.0 but as like other things
> i want to work on c++ in linux .. so i installed gcc
> on my linux box but i dont have any idea how to
> install it for example i write a program as follows in
> turbo c
> 
> #include<studio.h>
> #include<conio.h>
> void main (void)
> {
> printf("hello world");
> }

#include <stdio.h>

int main() {
  printf("hello wordl\n");
}

<stdudio.h> contains a typo

<conio.h> does not exists on Linux. It is not a C or C++ Standard
header file. Furthermore, I doubt that it is necessary at all for
building that program with your Windows compiler.

And now build the program with

g++ myprogram.cpp -o myprogram

Note that you should use 'g++' instead of 'gcc' for building C++
apps. g++ automatically uses some libraries that are often required
for building C++ apps.

It will generate an executable called "myprogram". If "-o myprogram"
were absent it will generate an executable named 'a.out'. It's a valid
executable, despite it's name. Execute your program with

./myprogram

note the ./ It's necessary because, out of the box, most shells does
not looks for executables on the current directory, so you need to say
"execute the 'myprogram' executable which is located on the current
directory"

 
> 
> 
> how do i write the same program in gcc ?
> i have tried the same but it gives out error the
> #in... files not found 
> what can i do & how to compile this program ?

Hope this helps.

Now execute the command 

info g++

and enjoy the fine manual :-)

-- 
Oscar

      reply	other threads:[~2002-06-29  1:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-28 18:15 faisal gillani
2002-06-28 18:47 ` Oscar Fuentes [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=wusiq2j5.fsf@wanadoo.es \
    --to=ofv@wanadoo.es \
    --cc=fasi_74@yahoo.com \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).