Thursday, July 30, 2009

If you learn c ++ do you know c also?

I have no clue.

If you learn c ++ do you know c also?
C++ is a superset of C, so if you were to learn all of the C++ constructs, you would then, by definition, know C.





That said, there are several constructs in C++ that replace the C versions. Examples include dynamic memory allociation (new and delete instead of malloc and free), the handling of files (streams instead of file pointers), and the handling of strings (STL string and stream classes instead of character arrays).





Also, if you are using C++ to its fullest extents, you are using Object Oriented principals. C is, by its nature, a structured language. You can do structured C++, but to do OO C requires some really awkward abstraction.
Reply:no c++ is extended c even though u will learn c but to implement it u will find difficulties





its a question like can a car driver, drive cycle
Reply:No.





C++ is derived from C. But C++ discourages its users from using what it brought from C for many reasons. So you will end up with no hands on in using those C features that C++ has. So you will not have learnt C by learning C++ to call yourself a serious C programmer. Only you will be able to write C code that tries to resemble the code that you would write in C++.
Reply:Yeah, its a little different. Lower level But hey, you also learn a lot of Java as well . :-)


Looking at C++ and Java you would have to look twice.
Reply:Hai Natedogg_ask,





Yes. C++ includes every thing of C plus many other features. C is the base of C++.


No comments:

Post a Comment