Bloomberg LP Interview Question
Software Engineer / DevelopersC does not have a class/object consept.C++ provides data abstraction,data encapsulation,inheritance and polimorfism.
C++ supports all C syntax.
In C passing value to a functions is"Call by value" whereas in C++ its "Call by reference".
File extension is .c in C while .cpp in C++
C++ can have inline/virtual functions for classes.
In C structures can not have contain functions declarations. In C++ structures are like classes,so declaring functions is legal and allowed.
One thing to note is that C++ is not exactly a superset of C. There are many subtle differences. For example, there is this thing called designated initializer in C99, that's basically a poor man's constructor for structs and a weird way to initialize arrays as well. There is no such thing in C++. There are even more subtle things, like
const char c[3] = "abc";
which compiles fine in C, resulting in a non-null-terminated string, but illegal in C++.
C++ is superset of C. It supports object oriented constructs. Built in - STL and RTTI.
- acoader@gmail.com November 03, 2008