LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-16-2005, 07:24 AM   #1
J_K9
Member
 
Registered: Nov 2004
Distribution: Slackware 11, Ubuntu 6.06 LTS
Posts: 700

Rep: Reputation: 30
Learning C


Hi,

I was learning C++, until one of my friends convinced me to scrap it and learn C. He put across a very good argument (I can't remember precisely what he said), but he did a good job!

Now, I know about the legendary CProgramming.com, but I was wondering if any of you could recommend a good book to buy - you see, I find it much easier learning from books that from a screen!

Thanks in advance,

M.

Last edited by J_K9; 09-16-2005 at 08:07 AM.
 
Old 09-16-2005, 08:22 AM   #2
DevandeAsk
LQ Newbie
 
Registered: Sep 2005
Posts: 8

Rep: Reputation: 0
have you try this link:
http://barnov.ath.cx/
or this..
http://ebook.irdesigner.com/index.php?cat=1
 
Old 09-16-2005, 09:07 AM   #3
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
How about learning both since C is used a lot in GNOME and GTK apps. C++ rules KDE and QT apps. Don't get sucked into other peoples views, do your own thing.
 
Old 09-16-2005, 10:28 AM   #4
mohit dhawan
Member
 
Registered: Mar 2005
Posts: 92

Rep: Reputation: 15
the c programming language by kernigham and ritchie is wht u r looking for..

u could also try LET us C by yashwant kanitkar.
 
Old 09-16-2005, 01:02 PM   #5
J_K9
Member
 
Registered: Nov 2004
Distribution: Slackware 11, Ubuntu 6.06 LTS
Posts: 700

Original Poster
Rep: Reputation: 30
DevandeAsk: Thanks for those links! I managed to get a C Reference Manual from the second one, but the first one didn't have any C-related topics...great sites though, so thank you for the links!

reddazz: It seems we meet again... I'm not being pulled into his views, it's just that I've realized that he is correct. I haven't learnt any language fluently yet (far from it!), and that's one of the reasons I'm going for C instead of C++: it can get very complex, and I'm only a noob!

mohit dhawan: Thanks! I'll check them out.... I'm currently trying the cprogramming.com tut actually, so I'll see how that goes - although I'm quite depressed that the first program wasn't "Hello World!"...hehe!

M.
 
Old 09-16-2005, 02:40 PM   #6
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
Just to put in my 2 cents... C++ isn't anymore complex then C. You will still have to deal with the same basic memory management issues and whatnot. C++ just caters itself to a different programming paradigm then C does (OO verses procedure... not to say you can use either paradigm in either language).
 
Old 09-16-2005, 03:13 PM   #7
J_K9
Member
 
Registered: Nov 2004
Distribution: Slackware 11, Ubuntu 6.06 LTS
Posts: 700

Original Poster
Rep: Reputation: 30
Ah, ok then...well, now I'm in the same position as before! Which to go for...C or C++...

M.

edit: Found the following two quotes (using Google) of a website - which I can't view, sadly enough, because it is blocked by the school:
Quote:
From FAQs.org

I think C is much better than C++ since the syntax is much easier to write. ...
-----------------------------------
I think C++ is better than C. Because C++ has OOPs concepts which C doesn't ...
Interesting...But is OOP really that much of an advantage?



I'm just trying to find some reviews which will compare them in an unbiased fashion - and I can only hope that they are easy to find!

Last edited by J_K9; 09-16-2005 at 03:21 PM.
 
Old 09-16-2005, 03:55 PM   #8
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Blog Entries: 9

Rep: Reputation: 48
Practical C Programming...published by O'reilly.

OR

Practical C++ Programming...published by O'reilly.

Both of these books are what I'm using to teach myself. I started w/ C++, switched to C, now I'm taking a class in C++
 
Old 09-16-2005, 04:34 PM   #9
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
To the extent OOP is an issue, I strongly recommend Java as a first language.

C++ has way too much "other stuff"; Java has much less "baggage"; Java is (IMHO) much closer to "pure OO".

Java is also much easier to learn.

In other words, I strongly believe that it's easier for a beginner to learn Good Habits from Java than it is for the same beginner to AVOID learning BAD habits in C++.

IMHO .. PSM

PS:
I don't think you can go wrong learning C. And I completely agree with mohit dhawan: K&R is hands-down the single best book you can get!
 
Old 09-16-2005, 05:29 PM   #10
deiussum
Member
 
Registered: Aug 2003
Location: Santa Clara, CA
Distribution: Slackware
Posts: 895

Rep: Reputation: 32
Quote:
Originally posted by J_K9

Interesting...But is OOP really that much of an advantage?

It really depends on the problem you are trying to solve. Some things are much easier to conceptualize with an OOD, and for some things trying to force it into an OO paradigm just doesn't work very well. The nice thing about C++ is that it lends itself well to both paradigms.

Another benefit of C++ is the ability to do generic programming via templates. (Something I found out has recently been added as an extension in the 1.5 Java SDK, and have heard is being included in the next C# release.) And the large collection of classes available in the STL. It's good to know the underlying mechanics of how to create your own linked lists and such, but once you know how, it is nice to be able to just use the standard containers in the STL to save some work.

Last edited by deiussum; 09-16-2005 at 05:32 PM.
 
Old 09-17-2005, 01:23 AM   #11
J_K9
Member
 
Registered: Nov 2004
Distribution: Slackware 11, Ubuntu 6.06 LTS
Posts: 700

Original Poster
Rep: Reputation: 30
microsoft/linux: Happy Birthday! Aside from that (heh!), what do you think of the Practical Programming books? I mean, I've had a good look at one before (Perl), but I didn't like it much - although they're bound to have it at the local bookstore, so I'll have a flick through!
Quote:
I started w/ C++, switched to C, now I'm taking a class in C++
This is what I'd like to do....learn C, and then - once I've become pretty good in it - switch over to C++ and learn that. And hey, if C is used a lot in GNOME and GTK, then I'm not complaining!

paulsm4: Hi! I've considered learning Java, but I - and you may not agree with me - find it a bit too high level to start out with...I mean, I first learnt Liberty BASIC, until I realized how useless it was. I then moved over to Perl, but gave up on it (and as the book didn't teach you using the "use strict" option, then it wouldn't have been a good way to learn how to program well). So, I then moved over to C++, and I'm just getting past loops right now, but I'm thinking of switching over to C: so, as you can see, I've dabbled in a few already... I may go on to learn Java afterwards, though, because it does seem to be the next up-and-coming language!

deiussum: Thank you for that! I found quite an advanced difference-review, which was quite interesting actually, so you may want to look at it...C vs. C++.

Yours Confusedly,

M.
 
Old 09-17-2005, 02:37 AM   #12
Itzac
Member
 
Registered: Feb 2003
Distribution: VectorLinux 5.1
Posts: 116

Rep: Reputation: 15
C++ is C with a few extra keywords that allow you to do Object Oriented Programming with it. I'd say your best strategy is to learn C first and become very comfortable with it before moving to C++. From there learning Java shouldn't be very hard at all.

I learned to program in C with "C By Example" by Greg Perry. ISBN# 0-7897-2239-9. I thought it was pretty decent. Since you already know a version of Basic, it should do you just fine.

Good Luck.
 
Old 09-17-2005, 03:14 AM   #13
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
You can also write GUI apps in GTK with C++ if you use gtkmm.
 
Old 09-17-2005, 07:41 AM   #14
J_K9
Member
 
Registered: Nov 2004
Distribution: Slackware 11, Ubuntu 6.06 LTS
Posts: 700

Original Poster
Rep: Reputation: 30
Iztac: Thanks! I'd say your best strategy is to learn C first and become very comfortable with it before moving to C++ - I think I'll go with what you said. I'm going to check out your book as well as K&R2 (which there seems to be quite a lot of hype about, so I better have a good look at that one!)

Nylex: Oh, ok...cool. So, is it also possible to write KDE apps in QT using C, or is that strictly C++? (As I said, I'm one of those who prefer GNOME to KDE.... )

M.
 
Old 09-17-2005, 08:21 AM   #15
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Quote:
Originally posted by J_K9
Nylex: Oh, ok...cool. So, is it also possible to write KDE apps in QT using C, or is that strictly C++? (As I said, I'm one of those who prefer GNOME to KDE.... )
As far as I know, Qt is only C++. Like you, I prefer GNOME .
 
  


Reply



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
Need help learning C++ Vodius Programming 8 05-16-2005 07:44 PM
learning c++ g2axiom Programming 14 12-31-2004 07:57 PM
Learning as I go. Curious LinuxQuestions.org Member Intro 1 09-25-2003 12:07 AM
Learning? slack105 Slackware 3 07-31-2003 12:46 PM
learning how much mb? nakkaya Linux - General 4 02-27-2003 10:04 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:14 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
Open Source Consulting | Domain Registration