Question:
I want to learn C++?
markcrosby.co.uk
2005-12-11 11:50:45 UTC
I know basic, html and a little javascript, but I need to know C++ too.

Do I need to learn C first to be able to learn C++?

I would like to learn it online. Can anyone suggest a good site that takes you through it step by step?
Three answers:
John C
2005-12-11 14:20:17 UTC
Personally, I learned C++ and object-oriented programming after I learned C.



C is a subset of C++, so this way I was able to make a living writing working C programs for a few years, before having to learn additional concepts (OOP) and additional language constructs (virtual functions, pure virtual functions, static methods, constructors, destructors, virtual destructors, const, class declaration, etc.)



The downside is, knowing those object-oriented programming techniques would have allowed me to design simpler, smaller programs. I could have built them in stages, rather than kind of all at once.



They would have fallen naturally into better organized modules too. When writing in C, I would have to think which functions to put in which .c file. When writing in C++, you put more or all of your code in objects. By convention, each class has its own .cpp file - so the decision of which file to put each function in is kind of made for you. And, that winds up making it easier to find each function too!



Outputting strings and numbers from a C++ program is much easier and far less error-prone than it is in C too. That will make your life easier right from the beginning.



So today, I would say you are better off learning C++ and kind of ignoring C. Do not feel like you have to learn the whole language at once. Take it slow.



You will be heartened to know many of the statements of both languages - especially the control structures - are the same: for, while, do, break, continue, if-else, and goto.



Learn one piece at a time.



Avoid using pieces of the language in a real program before you have studied up on that piece, learned the DOs/DON'Ts of it, and used it. If you try to do several new things at once, it can get very hard to figure out what mistake where caused something to go wrong. You wind up staring at an error, and not knowing where the program the fault lies.



To make an analogy, think about algebra. It is kind of easy to solve an equation where you only have one variable you do not know the value of. It is kind of hard to solve an equation where you do not know the values of two or three of the variables!



I have listed the URL of a pretty good C++ tutorial in the Sources section of this answer. Hope this helps!



By the way, after learning C and C++, I went on to learn to use Java. Java seems simpler than C++ and Java programs seem to have fewer errors in them the first time you run them to try them out. Java programming tools have overtaken C/C++ programming tools.



You may be required to learn C++ now, in which case this advice to consider Java will not help you. However, if you have a choice, try to find out if Java might be a better language for you than C++.
?
2016-12-07 01:54:59 UTC
sure it is often extra suited to learn C first and that i'll describe why. C is an especially regularly occurring purpose programming language. it is used to sparkling up a huge decision of programming issues. C++ takes it to a distinctive point by way of making merchandise orientated programming a lot much less confusing jointly as utilising the favourite library provided by way of C. C does have advantages too which includes a huge decision of extra desirable compilers to % between. you will no longer locate C confusing after studying C++ because of the fact I learnt C++ 4 years till now I even touched a C e book. in my opinion, coping with regulations in C replaced right into a discomfort in the neck no count in case you do it first or no longer you will could do it in some unspecified time sooner or later. it is suited to appreciate the two languages yet merely remember that ninety%+ of all the courses obtainable would be written in the two language.
computer-teacher
2005-12-11 12:48:29 UTC
It would be helpful to learn the basics of C programming first, before you start learning C++, but its not absolutely necessary.



The following are some good free tutorial and books that will get you going on learning C++:



Thinking in C: Foundations for Java and C++:

http://personales.unican.es/corcuerp/ThinkC/Home.htm



This blog post of mine contains links to 23 C and C++ Programming Ebooks and Tutorials:

http://www.intelligentedu.com/blogs/post/Best_New_Training_Sites/224/23-C-and-C-Ebooks-and-Tutorials



Here are C++ learning materials from only4gurus.net that will help you:

http://www.only4gurus.net/miscellaneous/cplusplus_faq.pdf

http://www.only4gurus.net/miscellaneous/cpp_book.pdf

http://www.only4gurus.net/miscellaneous/cpp_intro.pdf



Here are lecture slides from a class on Object-Oriented Design and C++:

http://www.cs.rit.edu/%7Eafb/20012/cs4/slides/



This post gives details and links for 2 Free C++ Books:

http://www.intelligentedu.com/blogs/post/Free_Computer_Books/236/2-Free-C-Books



Here is a book titled "Common Sense C - Advice and Warnings for C and C++ Programmers":

http://script.bluebull.com/archive/c/advice/



I hope these help you.

Computer-teacher


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...