LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 03-12-2012, 04:42 AM   #1
linuxrohit
LQ Newbie
 
Registered: Mar 2012
Posts: 5

Rep: Reputation: Disabled
Unhappy hello friends, i have just started learning c programing language in fedora 16


hello friends,

i have just started learning c programing language in fedora 16 n i have installed c compiler. Now when i type the program in terminal n executing it.
it is showing some errors
n the same thing when m doin by writing the program in text editor n save it in .c format n then opening in it terminal. it is working properly.
In my college when v do c programing v dont hav to go to text editor v can do it directly in terminal. from writing the program to executing everything is done in terminal.
so please guide me what is wrong m doin or in fedora 16 v have to do in this way only.
 
Old 03-12-2012, 09:05 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650
There are several text editors that run in a terminal such as vi (vim if you want syntax highlighting) and emacs. Learning to use one of these effectively is not necessarily trivial but you'll usually end up working more quickly than in a gui based one.
 
Old 03-12-2012, 09:38 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Hi, welcome to LQ!

First step to getting help is intelligible English; I strongly suggest you cut
out the smsish; on a keyboard it's not that hard to spell words out.


Cheers,
Tink
 
Old 03-14-2012, 05:35 AM   #4
linuxrohit
LQ Newbie
 
Registered: Mar 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
another problem

hello frnz,
thanks for uor response on my question.
i m gettin a problem when i write a program in terminal
#include <stdio.h>
main()
> {
> printf("\nC you later\n");
after this it gives a error
bash: syntax error near unexpected token `"\nC you later\n"'
y it is so please help me out i m really gettin pissed off
n please tell any book in which they have given c programming in fedora or any linux from beginning which can help me out
thanks...i ll hope ll get reply very soon
 
Old 03-14-2012, 10:27 AM   #5
jkirchner
Member
 
Registered: Apr 2007
Location: West Virginia
Distribution: LinuxMint 18
Posts: 747

Rep: Reputation: 182Reputation: 182
Looks like you forgot a return 0; and a } (closing brace).

The best book, in my opinion, is the K&R, The C programming Language by Kernighan and Ritchie. I also liked C Primer Plus by Stephen Prata. There are lots of tutorials online and many free resources as well, just search a little.

You really should work harder at spelling out words in your posts, like friends instead of frnz.

Also use code tags when posting code, it makes it more readable.

Last edited by jkirchner; 03-14-2012 at 10:32 AM.
 
1 members found this post helpful.
Old 03-14-2012, 10:33 PM   #6
linuxrohit
LQ Newbie
 
Registered: Mar 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
thanks

hello friend,
thanks for telling me all these things
one more question i have and that is do we have to write all this program in text editor (i am using gedit)
and then compile and execute in c terminal or we can write the program in terminal and there only compile and execute
Quote:
Originally Posted by jkirchner View Post
Looks like you forgot a return 0; and a } (closing brace).

The best book, in my opinion, is the K&R, The C programming Language by Kernighan and Ritchie. I also liked C Primer Plus by Stephen Prata. There are lots of tutorials online and many free resources as well, just search a little.

You really should work harder at spelling out words in your posts, like friends instead of frnz.

Also use code tags when posting code, it makes it more readable.
 
Old 03-14-2012, 10:37 PM   #7
linuxrohit
LQ Newbie
 
Registered: Mar 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
thanks

hello friend,
thanks for telling me all these things
one more question i have and that is do we have to write all this program in text editor (i am using gedit)
and then compile and execute in c terminal or we can write the program in terminal and there only compile and execute
 
Old 03-15-2012, 01:59 AM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,241

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
If(!) I understand the qn, you do have to use and editor of some sort, you can't type direct onto the terminal cmd line; it won't understand.
You can either use a GUI editor like gedit, or you can use an editor on the cmd line eg vim.
In either case, you then compile & execute (if compile goes ok).

This http://rute.2038bug.com/index.html.gz is a good tutorial on Linux and also has a C programming section at Chap 22.
I suggest you read it closely.
 
1 members found this post helpful.
Old 03-15-2012, 04:59 AM   #9
linuxrohit
LQ Newbie
 
Registered: Mar 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Smile thanks

thanks sir you are right that was my question thanks for your help i hope in future also you will be very helpful to me.
Quote:
Originally Posted by chrism01 View Post
If(!) I understand the qn, you do have to use and editor of some sort, you can't type direct onto the terminal cmd line; it won't understand.
You can either use a GUI editor like gedit, or you can use an editor on the cmd line eg vim.
In either case, you then compile & execute (if compile goes ok).

This http://rute.2038bug.com/index.html.gz is a good tutorial on Linux and also has a C programming section at Chap 22.
I suggest you read it closely.
 
Old 03-15-2012, 09:46 AM   #10
konsolelover
Member
 
Registered: Jul 2011
Location: 127.0.0.1
Distribution: Arch, Ubuntu 11.04
Posts: 78

Rep: Reputation: 3
Quote:
Originally Posted by linuxrohit View Post
In my college when v do c programing v dont hav to go to text editor v can do it directly in terminal. from writing the program to executing everything is done in terminal.
I guess you're talking about an IDE like Borland Turbo C++. If you're interested in an IDE , you can use "Code::Blocks" and download it from here.
 
  


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
[SOLVED] Can you tell me the better site for learning programing language?? amwjatyvh Programming 19 05-30-2010 11:07 AM
Where would a good place to start learning basic programing and scripting? Game Pro Programming 10 03-04-2008 08:06 PM
Best Beginner programing language... computer_tom Programming 95 12-20-2007 03:58 PM
help: looking for right programing language... computer_tom Programming 8 11-07-2006 11:52 AM
Getting Started with Programing dosnlinux Linux - Software 5 04-29-2005 04:28 PM


All times are GMT -5. The time now is 05:52 PM.

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