LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-14-2007, 05:30 AM   #1
decodedthought
Member
 
Registered: Oct 2007
Location: California,USA
Distribution: Archlinux
Posts: 195

Rep: Reputation: 20
C++


i am actually learning c and c++ rite now in college and i am coding in linux ..
how do i compile and run the code ???
help is very much appreciated


THANKS IN ADVANCE >>
 
Old 10-14-2007, 06:18 AM   #2
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
My advice (even though I'm not a master programmer) would be to not learn C and C++ at the same time..I've tried, didn't work out. Learning C first seems more logical.

To compile you run the compiler, for example gcc (Gnu Compiler Collection).
Code:
man gcc
A simple example for a simple C file would be
Code:
gcc code.c
which would produce an executable called 'a.out' if it succeeds; or,
Code:
gcc code.c -o code-executable
to get a 'code-executable' named executable (instead of the default 'a.out').
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off




All times are GMT -5. The time now is 11:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration