What's the difference between them all?
Printable View
What's the difference between them all?
Well C and C++ are both languages. C++ is based upon C, basically it extends the C langague. For exmaple C didn't have oop, that was one of the extentions made with C++.
Turbo C is an old compiler.
So the coding is all the same (sort of)?
well if you learn C++, you learn c at the same time.
And the other way around? I have a Turbo C class at uni I am thinking of taking, that's why I'm curious...
I believe Turbo C was Borland's C development tool. The language should be roughly the same between different environments, but not always, and not completely. Pre-processor directives were wildly fluid between compilers, for instance.
Going from C++ to C would be easy. Going from C to C++ would not be so easy. Especially when you add the Standard Template Library. C is a good place to start for C++, since the syntax would be the same. However, C++ adds huge gobs of items.
OK. Thanks for all the info :thumb: :)
Others (including me) say that learning C in order to prepare for C++ is a bad thing.
BTW, if you're not an IE-user, go here for C++:
http://stud3.tuwien.ac.at/~e0226430/...al/index.xhtml
Thanks for the link! I'll definatelly look at it ;)Quote:
Originally posted by CornedBee
Others (including me) say that learning C in order to prepare for C++ is a bad thing.
But, why is it bad?
1) It's harder than necessary. C++ has a standard library that greatly assists programmers get over the hard parts of C like string handling. By learning C before C++, you give up this advantage.
2) C is procedural, C++ is object-oriented. The hardest part (IMHO) about learning a language is not its syntax, it's the mindset. The second hardest part isn't the syntax either, it's the default library and built-in functions. C++ has a different mindset and a different default library than C (although it supports both in their C versions), so learning C before C++ means that you learn a syntax and the general programming basics: variables, loops, branches. That's only a small part, and whatever else you put into learning C is wasted unless you plan to use C.
Generally what is used more? C++? Would you suggest C++ over C in term of flexibility and capabilities?
I don't know exactly, but overall, I believe C++ is used more. C is used a lot for libraries that do things, a lot for small programs and almost exclusively for hardware-near programming.
C++ is used for larger applications, to write programs that make use of the libraries.
The capabilities are the same. There's no effect in C you can't achieve in C++ and vice versa. It will, however, be easier in C++ most of the time and equal in the few exceptions where C would be better than C++, because C++ is still a superset of C.
I don't know about flexibility. I have a hard time making anything real out of this term.
The advantage that C++ really gives you is, I believe, to do more with less code or at least clearer code, while not compromising on speed, at least not as much as most other languages (like Java) do.
OK, thanks for the clarification CB :thumb:
Like I said above, when you learn C++ you will also learn C.Quote:
Originally posted by manavo11
Generally what is used more? C++? Would you suggest C++ over C in term of flexibility and capabilities?
C++ is used more because of OOP and templates. It has many different tools that you can use to solve various problems with. The hard part of this langauge is knowing what tools to use when. Basically you can write windows programs with the API, MFC, .net, WTL, or even QT3 depending upon your needs. Pretty much this langauge takes a lot of time to learn. You won't create windows programs for a long time just because the langauge is so complex and you have to learn it first.
C is used mostly for programs or librarys that need maximum speed. The windows API for example was written in C.
:afrog: