Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 03-13-2003, 12:39 AM   #1 (permalink)
ic38
Registered User
 
Join Date: Mar 2003
Location: Melbourne, Australia
Posts: 8
ic38 is on a distinguished road
Learning C/C++

I'm very interested in learning C/C++

I've got experience with php which is what I mainly do things in at the moment.

I want to broaden my horizons, so to speak.

I'm wondering the major differences between C and C++, recommendations...

Either a good tutorial on the internet or a book someone found particularly good.

Thanks in advance.
ic38 is offline   Reply With Quote
Old 03-13-2003, 04:28 AM   #2 (permalink)
alpha
Regular Contributor
 
Join Date: Feb 2003
Posts: 120
alpha is on a distinguished road
Send a message via AIM to alpha
You can try to run a search, both here and google. You should find many tutorials. Try the ones here at this site, and here. (hope this isn't against the rules).

There aren't too many differences with C and C++, as far as syntax goes. But the huge difference is that C is procedural and C++ is object-oriented. OOP can be very powerful. It can be tough for some to grasp the idea of OOP at first; but just keep practicing, and you will be fine.
As for recommendations, it is dependent on what you want to do; however, you do not need to learn C before C++, imo. I didn't learn C before C++, and I am still learning C++ (through a class, and on my own). Some would recommend learning C++, then C, because you learn a lot of C on the way of learning C++.

As for books, again, a search woud be ideal. try here, and here. There are many more sites with recommendations, as a search of here would help.
alpha is offline   Reply With Quote
Old 03-13-2003, 06:05 AM   #3 (permalink)
Travis Dane
Code Monkey
 
Travis Dane's Avatar
 
Join Date: Feb 2003
Location: Netherlands
Posts: 89
Travis Dane is on a distinguished road
Send a message via ICQ to Travis Dane
C++ has everything C has and more, So learning C would make
no difference from learning C since C++ is perfectly backwards
compatible with C, I'm still wondering why some people
recommend learning C first, I sure din't.
__________________
OpenGL, DirectX
Travis Dane is offline   Reply With Quote
Old 03-13-2003, 06:28 AM   #4 (permalink)
yamaha_r6
Registered User
 
Join Date: Mar 2003
Location: Motor City
Posts: 3
yamaha_r6 is on a distinguished road
A lot of people recommend C before C++ because there is a huge paradigm shift when going from an OOP to a procedural language. The transition backwards can be more difficult because you have to forgo many of the concepts of C++, whereas going from C to C++ you can apply additional concepts to a base knowledge.

If you're going to sit at home and write your own programs for your own personal use, either language will do. If you decide to get involved in a project, C is still the dominate language (for example the GTK+ tool kit, Linux Kernel, BSD kernel, enlightenment, GNOME, and a miriad of other C OpenSource projects). C++ hasn't caught on as much because there are still many old programmers out there who refuse to use it, and the concepts of OOP are not always required for a project. There are a few OOP projects out there (QT, KDE) but not as many as good'ol C.

My $.02

As far as good books go, Two of the best I've encounterd are:

C A Modern Approach by K.N. King
Pointers On C byKenneth A. Reek

The K.N. King book is the better of the two, but they are both superb books.
yamaha_r6 is offline   Reply With Quote
Old 03-13-2003, 10:39 AM   #5 (permalink)
joe_bruin
LOAD "*",8,1
 
Join Date: Feb 2003
Location: la.ca.us
Posts: 254
joe_bruin is on a distinguished road
c is not used because old programmers refuse to change.
c is much more portable than c++ (have you ever tried switching to a different compiler that uses a different stl implementation? it's not fun). c can be run on systems with no dynamic memory allocation (no malloc, no 'new'), which is often the case in embedded systems.

the truth is that c++ and object oriented programming make designing large programs easy and make coding convenient. they also have a tendency to encourage large memory useage and sacrifice performance for abstraction. virtual function calls are unacceptably slow when performance is critical. multiple inheritance ends up with classes that have unused (hidden) data fields that are a waste of memory. copy constructors, autopointers, implicit function calls (such as destructor functions), and implicit pointer indirection ('this'), all contribute to this and are things you do not what when you need tight control of your code. when you don't care about convenience, but performance and memory footprint are what matters, c is the only way to go.

some things that are written in c:
windows kernel and the win32 layer, linux kernel and most linux/unix applications (from 'apache' to 'Xfree86'), any bsd, solaris, aix, hpux, tru64, qnx, most other os's, most drivers, oracle, db2, sybase, ...
joe_bruin is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
perl bot (learning) revolution All Other Coding Languages 15 10-21-2004 12:43 PM
Learning C++ Nitro Standard C, C++ 18 05-27-2004 03:08 AM
Learning C? Admin Standard C, C++ 3 05-05-2004 03:51 PM
new to python? revolution All Other Coding Languages 4 10-22-2003 10:08 AM
Learning Vi? w00t Linux / BSD / OS X 12 03-15-2003 12:48 PM


All times are GMT -8. The time now is 08:24 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting