DIGIT-ARC read-only archive · snapshot: July 23, 2026

Help me learn C language

66 posts · originally from https://geek.digit.in/community/threads/help-me-learn-c-language.76216/

baccilus
baccilus Original post #1
Dec 20, 2007 at 10:19 PM
I am a student of microbiology. For some reason, C language is included in our syllabus. I need your guidance regarding these things:

1. Which online/offline book to consult
2. How do I practice it in my linux box? I have gcc installed but I don't know how to bring it up or start working on it like sir was while demonstrating it on turbo c++ software on windows.

Please consider that I am a medical student and would also need to know about the basics like what's a compiler,what's a LLL, Hll, etc.

I think I should have posted in programming section. Sorry about that. Can someone move this please?

I also saw a post regarding alternative to turbo c but I still need answers to both my questions since I am a complete noob and I have different requirements.
cool_callis
Dec 21, 2007 at 12:04 AM
i will suggest u following book for beginning
1.c primer plus
2.c in a nutshell
both r really very good books .get hard copy of ny one which is available .
once u have mastered basics for perfection u can follow
1. c programming language by dennis ritchie (creator of c language)
the best c book but u will not understand this if u first read this book.
c in a nutshell book has given complete detail on compiling and debugging
QwertyManiac
Dec 21, 2007 at 12:13 AM
To use GCC, open terminal and do this to compile your written C file:
Code:
gcc <filename_of_program>.c -o <somename_for_output_file>
And once compiled successfully by the above command (No o/p == Success), do this to run the program:
Code:
./<somename_for_output_file>
baccilus
Dec 21, 2007 at 12:31 AM
Will these books have the kind of basics that I am gonna need. I need basic definitions and explanations too. How about Balaguru Sami or Nitin Upadhya's book? My friend has them so I won't have to buy them. Are they any good?
cool_callis
Dec 21, 2007 at 12:38 AM
if u need only basic knowledge then u can follow balaguruswamy or book by yashwant kanetkar (let us c)
as u need only basic knowledge i suggest that 'let us c ' by yashwant kanetkar will be the most suitable book for u . i has very simple language and suitable for noobs to programming and those who need only basic knowledge . get this book.it has simple language nd easier to understand than balaguruswamy book.
anantkhaitan
Dec 21, 2007 at 8:56 PM
QwertyManiac said:
Code:
gcc <filename_of_program>.c -o <somename_for_output_file>
Better include -W for the warning(s): :)
Code:
gcc -W <filename_of_program>.c -o <somename_for_output_file>
praka123
Dec 21, 2007 at 9:10 PM
@baccilus are u good in math :?: I am not and i struggle with programming,still dont know anything even with C although i passed exams long back 9 yrs ago :p
Pathik
Pathik #8
Dec 21, 2007 at 9:25 PM
baccilus said:
Will these books have the kind of basics that I am gonna need. I need basic definitions and explanations too. How about Balaguru Sami or Nitin Upadhya's book? My friend has them so I won't have to buy them. Are they any good?
Try Kernighan & Ritchie.
The_Devil_Himself
Dec 21, 2007 at 9:30 PM
balagurusamy's and kanitkar's are good for nothing.
hayabusa_ryu
Dec 21, 2007 at 10:07 PM
I suggest that u should go for C : The Complete Refrence published by Tata McGraw Hill and then go for C : How to program written by Deitel & Deitel published by Prentice Hall and lastly go for C The Programming Language by Ritchie and Kernigham. You can also try Yaswant Kanitkar's book
anantkhaitan
Dec 21, 2007 at 10:11 PM
Programming in ANSI C, E Balagurusamy is quite good..
baccilus
baccilus #12
Dec 21, 2007 at 10:44 PM
@Praka: I am a medical student. I suck at maths.

I think I will give Balaguruswamy a try first since I won't have to buy it. If I don't understand it, I will go by Hayabusu's advice although I will just read one of them (Have to focus more on my majors, C is subsidiary)

By the way I have installed Anjuta. That's good right?

@Devil: Can you elaborate please.
Indyan
Indyan #13
Dec 21, 2007 at 10:48 PM
I would reccomend Balaguruswamy and Let us C to start with.
Let us C is very well written and is actually a fun read.
praka123
praka123 #14
Dec 21, 2007 at 10:50 PM
@baccilus:yeah Anjuta IDE is very nice and easy :)
The_Devil_Himself
Dec 21, 2007 at 10:54 PM
Indyan said:
I would reccomend Balaguruswamy and Let us C to start with.
Let us C is very well written and is actually a fun read.

please,please don't misguide!!it takes a lot of time to get over the 'kanetkar syndrome'.


@baccilus:I don't think you need any IDE for basic programming,just use a siple text editor and then use gcc to compile,as simple as that.

One humble request,get a good book instead of even trying balagurusamy,I have thsi book and it sucks! some good book will make learning c a pleasure like it should be.
praka123
praka123 #16
Dec 21, 2007 at 10:58 PM
I bought long back C for Dummies.it is lieing here in my room.it follows instructs for turbo C which i dont use.but id have to say-it is very easy if u have time though.
baccilus
baccilus #17
Dec 22, 2007 at 8:55 PM
Devil; I think I will flip the pages a bit and see how he has tried to explain the things. Personally I too like books where author tries to make things simple, rather than throwing knowledge at you. Any book you think is nice and simple which manages to get the concept across?



I can also get "let us C" from Brit library I guess. Will see these and get back to you guys.



Thanks for the help guys.
gary4gar
gary4gar #18
Dec 22, 2007 at 9:07 PM
get yourself a copy of K&R, it comes for 90 or 100 bucks
damnthenet
Dec 23, 2007 at 1:10 PM
Balagurusamy ought to be enough for a addied paper
MetalheadGautham
Dec 23, 2007 at 3:00 PM
I noticed that Dev C++ has a built in instruction set for C programming. My friend, who is in this forums, but has not yet posted, has learnt C exclusively through Dev C++'s built in help.
Faun
Faun #21
Dec 23, 2007 at 4:00 PM
hayabusa_ryu said:
C : How to program written by Deitel & Deitel published by Prentice Hall
ftw :D
Yamaraj
Yamaraj #22
Dec 23, 2007 at 4:13 PM
Anyone recommending Kanetkar books should be hanged and fed to vultures.

C Primer Plus is an excellent text. K&R is tough on beginners, and was originally meant for programmers not familiar with C. Stephen Kochan's Programming in C, 3rd edition is also quite good for starters. I also recommend A Book on C by Kelley and Pohl.
Faun
Faun #23
Dec 23, 2007 at 4:28 PM
Yamaraj said:
Anyone recommending Kanetkar books should be hanged and fed to vultures.

C Primer Plus is an excellent text. K&R is tough on beginners, and was originally meant for programmers not familiar with C. Stephen Kochan's Programming in C, 3rd edition is also quite good for starters. I also recommend A Book on C by Kelley and Pohl.
I never learned from Kanetkar:-D,

K & R is for hardcore sys programming:mrgreen:

Deitel and Deitel is a good option (includes a primer to C++ and JAVA).
MetalheadGautham
Dec 23, 2007 at 5:53 PM
there is a book on C programming by Dennis Ritchie. It is absolutely amazing, even for n00bs. He explains every concept, and gives lots of tips. His english is also scholary.

PS: for those who don't know, Dennis Ritchie invented C
praka123
praka123 #25
Dec 23, 2007 at 6:34 PM
...and co-invented UNIX for which C Programming Language was made. :D
gary4gar
gary4gar #26
Dec 23, 2007 at 7:42 PM
but a word of caution K&R is book for those who already know some programming in any langage. n00bs will find difficult to understand.

the as the opening text of book is
"there is no other to learn to program, then to program itself, so lets get started":D
Code:
#include<stdio.h>
int main()
{
printf("hello world \n");
return 0;
}

so the book is closer to *UNIX, so windows wienies may not understand some *UNIX related concepts, like the file system handling etc etc*farm3.static.flickr.com/2134/2122604649_e2f8e1a9b0_o.png
praka123
praka123 #27
Dec 23, 2007 at 8:15 PM
books are not responsible atleast 20%!there is no change if u collect these books!make sure u have a good lecturer,guide.with pupils poor in Maths,they sure need a lecturer for C programming etc.no self studying.
best way to learn programming is to make sure whether ur nice in Math or not.i ur not good in math(<60%) then Programming can be left for those geeks and you can try some good with politics ;) or arts etc :D
ofcourse no offense meant to any!JFYI :)
^...@gary:waiting for ur fast track to C programming :)
A
adi007 #28
Dec 24, 2007 at 12:20 PM
Yamaraj said:
Anyone recommending Kanetkar books should be hanged and fed to vultures.
^^please tell why??:confused:
though i have not learned C by it but i found it ok...

there are lots of downloadable e-books regarding programming languages at
www.freeprogrammingresources.com/books.html
but i personally feel that no e-book can replace the good old normal books..:D
gary4gar
gary4gar #29
Dec 24, 2007 at 12:45 PM
wise man said:
All books by Yashwant Kanetkar including books like Let US C, Working with C, Data structure through C. The problem with his books is that, though they are easy to read, but they contain lots of factual errors. They do not address the fact that certain aspects of C is implementation dependent.

one word:AVOID THEM

praka123 said:
^...@gary:waiting for ur fast track to C programming :)


oh didn't read this....lol i can't code anything properly apart from "Hello world" program:D
do you need to fast track to hello world:p
Yamaraj
Yamaraj #30
Dec 24, 2007 at 4:07 PM
adi007 said:
^^please tell why??:confused:
though i have not learned C by it but i found it ok...
You also find TC++ ok. I came, I saw, I detested. And I won't explain why.
baccilus
baccilus #31
Dec 25, 2007 at 1:09 AM
Any views on Nitin Upadhyay?
baccilus
baccilus #32
Jan 8, 2008 at 7:40 PM
Ok guys.... I just came across " C-Primer Plus" by Stephen Prata. I have just read the introductory chapter and found it quite interesting. Now how is this book?
praka123
praka123 #33
Jan 8, 2008 at 7:46 PM
^good reviews for that book;afaik yashawantha kanitkar's Let Us C also have above book as referral.use gcc or any ANSI/ISO compliant compilers for testing.
QwertyManiac
Jan 8, 2008 at 8:05 PM
Will you be just searching for books and not go on with C really at all? By now you should have become a master in its basics, like writing to a file and all!
baccilus
baccilus #35
Jan 8, 2008 at 8:22 PM
LOL... Ya I am learning it too. Can already write basic programs like asking for name, age, class and masks and then displaying them. But had been learning from computer sir till now. I am using Anjuta IDE by the way.

Guys I am finding it more interesting than my major subject( Microbiology), probably because I am still studying the easy part.
praka123
praka123 #36
Jan 8, 2008 at 8:32 PM
^yeah a possible Math phobia case like me ;) if ur weak in programming that is!(i am!) u may be very much intelligent but fears from math or programming,this is Math Phobia ;)
baccilus
baccilus #37
Jan 15, 2008 at 10:58 PM
I have been learning C from the past few days and am loving it.

I have recently started getting into a problem with my anjuta IDE compiler in linux.
There are several header files it doesn't find. I learn to write some program in the class(windows) but can't run it at home on my linux box. From the errors it seems that I don't have "iostream.h" and "conio.h" header files. How can I install them?

I just realized that I don't have most of the header files. I tried to execute some programs given in this forum but none executed because of some header file or other.
2kewl
2kewl #38
Jan 15, 2008 at 11:10 PM
C & DS by E. Balagurusamy is a good one to start off with
baccilus
baccilus #39
Jan 15, 2008 at 11:17 PM
What about the header files problem?

By the way I have decided to go for C primer plus. Am already reading an *ahem* version. Will buy it soon :)

But do something about the header files problems. Its really irritating :-(
QwertyManiac
Jan 15, 2008 at 11:36 PM
Conio.h is Turbo exclusive (Platform Dependent - Windows).

To include iostream, in standard C++, use:
Code:
#include<iostream>

No .h's.
baccilus
baccilus #41
Jan 15, 2008 at 11:40 PM
Didn't help..... Still giving syntax error telling that no such file found.

OK... I found the problem.... I was using the extension of .c rather than cpp. Also I wasn't supposed to use .h extension (as told to me by QM.)

I am supposed to learn C. Now won't this be a bit problematic for me..... I mean using C++'s rules?
M
mehulved #42
Jan 15, 2008 at 11:50 PM
You have c++ libraries installed?
baccilus
baccilus #43
Jan 15, 2008 at 11:52 PM
@mehulved
OK... I found the problem.... I was using the extension of .c rather than cpp. Also I wasn't supposed to use .h extension (as told to me by QM.)

I am supposed to learn C. Now won't this be a bit problematic for me..... I mean using C++'s rules?
M
mehulved #44
Jan 17, 2008 at 3:03 PM
Sorry I misread. All Qwerty's fault :p
There's no iostream in C AFAIK, iostream is part of C++.
To check again, I tried some searches on google but I get -ve for it.
QwertyManiac
Jan 17, 2008 at 3:15 PM
Lol yeah, I just noticed my fault too!

Use stdio.h, why did you even include iostream? Which book's nonsense is this? :p
M
mehulved #46
Jan 17, 2008 at 3:24 PM
Use stdio.h, why did you even include iostream? Which book's nonsense is this? :p
I dobut it's a book. Looks more like an ignorant teacher's fault or maybe a book on TC.
And you're just reaching 5K posts :confused:
°
Jan 19, 2008 at 9:26 PM
I noticed that Dev C++ has a built in instruction set for C programming. My friend, who is in this forums, but has not yet posted, has learnt C exclusively through Dev C++'s built in help.

Thanks for mentioning that GT. Dev c++'s built in help file is very useful but at the same time does not cover the entire c language deeply. Its just for newbies who want to get their feet wet.
MetalheadGautham
Jan 22, 2008 at 6:35 PM
Thanks for mentioning that GT. Dev c++'s built in help file is very useful but at the same time does not cover the entire c language deeply. Its just for newbies who want to get their feet wet.
Dev FTW... btw, just see the wikibooks ebook on C, C++, Perl and Python. They are even better than Dev-CPP
D
dsuresh #49
Jun 3, 2008 at 3:55 PM
c online tutorial
*www.cs.cf.ac.uk/Dave/C/
M
Jun 3, 2008 at 4:08 PM
haha... i believe he won't need any book if we all are gonna teach him 1 topic of C here on forum.. lol
gary4gar
gary4gar #51
Jun 3, 2008 at 5:52 PM
Did you try Using Geany?
Its very much user friendly
sourav123
sourav123 #52
Jun 3, 2008 at 6:38 PM
Is there any book that teaches using GCC? I learnt C 4 years back in University, and that time I was using Windows. I would like to go over it again using Linux and GCC.
gary4gar
gary4gar #53
Jun 3, 2008 at 7:21 PM
No need to follow GCC, Just follow the Standard
Take any book Like K&R which follows the ISO C99 standard, you would do fine;)
sourav123
sourav123 #54
Jun 3, 2008 at 9:14 PM
No need to follow GCC, Just follow the Standard
Take any book Like K&R which follows the ISO C99 standard, you would do fine;)

I know that. But actually I wanted to know all the GCC functionalities also besides writing the C code.
M
mehulved #55
Jun 3, 2008 at 9:23 PM
Is there any book that teaches using GCC? I learnt C 4 years back in University, and that time I was using Windows. I would like to go over it again using Linux and GCC.
You want to know about C programming using gcc? Then refer to any good book on standard C programming.
If you want to know indepth about gcc then check it's online documentation *gcc.gnu.org/onlinedocs/gcc-4.3.0/gcc/
Garbage
Garbage #56
Jun 3, 2008 at 9:28 PM
I know that. But actually I wanted to know all the GCC functionalities also besides writing the C code.
And there is a book named "The Complete Reference to GCC". I has this eBook.
gary4gar
gary4gar #57
Jun 3, 2008 at 9:58 PM
Try command "man gcc" :p
hjpotter92
Jun 6, 2008 at 9:52 AM
Though Harry Potter doesn't need to have any problems regarding C++. He uses his wand for that, butI am not Potter so I need some help for that purpose. I have attached a file which may be extracted and the extension should be changed from txt to cpp and try it in the blue screened TC. i am facing more than 25 errors in it.
dheeraj_kumar
Jun 6, 2008 at 10:07 PM
^^ Dude bad archive?

And by the way, HP solves problems not because of his wand, but because of his automatic debugger(Hermione) :D
hjpotter92
Jun 7, 2008 at 5:14 PM
Does he? really, then think about the fight b/w Voldemort and him. He didn't use her but fought alone. And as for the exams, he can't cheat the pen are cheating proof.
The archieve is all right. I downloaded it once more to check it.
dheeraj_kumar
Jun 7, 2008 at 7:18 PM
Well she solves lab problems... Voldemort was final exam so couldnt help :D

Strange.. WinRAR says unknown archive format...
hjpotter92
Jun 9, 2008 at 10:30 PM
It is realy funny. But it does downloads and works well on my sys.
M
mehulved #63
Jun 9, 2008 at 10:48 PM
Doesn't open for me either. Try to use some pastebin like rafb.net/paste
abhinandh
abhinandh #64
Jun 15, 2008 at 7:00 AM
nor does it work for me.
hjpotter92
Jun 15, 2008 at 4:47 PM
Ok its is really funny. Try this out: It must work
*willhostforfood.com/users/hjpotter92/Crar.png
M
mehulved #66
Jun 15, 2008 at 8:57 PM
Why can't you simply use a pastebin, it makes things so much eaiser for everyone.

Anyways, I can't check since it's not C++ but Turbo C++.