LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxAnswers Discussion
User Name
Password
LinuxAnswers Discussion This forum is to discuss articles posted to LinuxAnswers.

Notices

Reply
 
Search this Thread
Old 07-02-2011, 03:49 PM   #31
dugan
Senior Member
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 4,665

Rep: Reputation: 1440Reputation: 1440Reputation: 1440Reputation: 1440Reputation: 1440Reputation: 1440Reputation: 1440Reputation: 1440Reputation: 1440Reputation: 1440

Quote:
Originally Posted by TheStefan12345 View Post
I just bought a book, and it doesn't say that you need using namespace std; and you need iostream.h

What the hell?
The book is outdated. Throw it out.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 11-21-2012, 11:06 PM   #32
durgam anil
LQ Newbie
 
Registered: Oct 2012
Location: banglore,india
Distribution: open suse,redhat,ubuntu
Posts: 13
Blog Entries: 1

Rep: Reputation: Disabled
compiling the c and c++ codes

in vi editor:

for c:
in shell :
step 1:type vi <your_program_name>.c
step 2: type gcc <your_program_name>.c -o <your_program_name>.out
or
type gcc <your_program_name>.c -o a.out
step 3:type ./<your_program_name>.out
or
./a.out

for c++:
in shell :
step 1:type vi <your_program_name>.cpp
step 2: type g++ <your_program_name>.cpp -o <your_program_name>.out
or
type g++ <your_program_name>.cpp -o a.out
step 3:type ./<your_program_name>.out
or
./a.out
 
1 members found this post helpful.
Old 10-03-2013, 09:27 AM   #33
NoStressHQ
Member
 
Registered: Apr 2010
Location: Lausanne - Switzerland ( Bordeaux - France / Montreal - QC - Canada)
Distribution: Slackware Leet - 32/64bit
Posts: 279

Rep: Reputation: 94
Quote:
Originally Posted by partha6794 View Post
There is a easy method to bulid "C" & "C ++ " programming:

There are three methods to bulid "C" & "C++" programming in RHL 9.0 & FC .by using GNOME desktop & another in KDE .
There are mainly two editor in GNOME , viz. vi- editor & another is emacs editor.I will discuss both here.



using VI-editor:

1. open terminal .
2. type for C programming
vi <filename>.c

for C++
vi <filename>.cpp

e.g:

vi hello.c { for C}
vi hello. cpp { for C++}

3. then type " i" ( i= insert)
4. then write source code . for details www.howstuffworks.com how to works "C" programming?
5. then press
esc : wq
it is save now.

6. now for comile the programme type,
cc <filename>
7. then for execute type
(dot)/a.out ( dot = . )

8. then it will see your screen.


USING EMACS EDITOR:

1.type emacs<file name> on terminal.
3. then type " i" ( i= insert)
4. then write source code . for details www.howstuffworks.com how to works "C" programming?
5. then press
esc : wq
it is save now.

6. now for comile the programme type,
cc <filename>
7. then for execute type
(dot)/a.out ( dot = . )

8. then it will see your screen.


USING KWRITE IN ( GNOME OR KDE DESKTOP)

1. Open terminal & type kwrite
2. then write source code
3. then click file .
4. then clck save as
5. save the file wtth extension .c/.cpp
now for comile the programme type,
cc <filename>
7. then for execute type
(dot)/a.out ( dot = . )


I hope it will helpful .


If you face any diffuculty u can email me
partha_26786794123@yahoo.com , ( for alert reply here)

partha
I know this is old... But the EMACS help is strange... It describes VI syntax NOT emacs !!
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
DISCUSSION: Building C programs on Linux crabboy LinuxAnswers Discussion 29 09-04-2013 10:19 AM
DISCUSSION: Building a Slackware Wireless Access Point eric.r.turner LinuxAnswers Discussion 11 09-09-2006 01:36 AM
DISCUSSION: ssh w/ gtk programs (host-client display export) mrchaos LinuxAnswers Discussion 1 12-14-2005 01:50 PM
DISCUSSION: Compiling Programs from Source jeremy LinuxAnswers Discussion 51 11-21-2005 04:35 AM
DISCUSSION: Virtual Filesystem: Building a Linux Filesystem from an Ordinary File mchirico LinuxAnswers Discussion 0 10-28-2004 10:35 PM


All times are GMT -5. The time now is 08:38 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration