I dont disagree with you dwks, but I dont see C++ as a seperate language from C. It has more features for sure, just as modern english is more descriptive than english of say 100 years ago. Both can be translated into grunts whistles and other basic phoenetic primitives. That doesnt make 19th century english and modern english 2 seperate languages, nor does it mean we should all go around speaking in phoenetics either. I can obviously translate any modern phrases into terms in use in the 19th century, granted it woudl take longer to express teh same concepts, just as it woudl take more lines of code to express the same behavior in C as in C++. Again, this does not make them seperate languages, merely differnt dialects at most.
Originally Posted by
vart
it is for dynamic memory allocation, what it has to do with classes? If you do not use classes?
new/delete is the primary way to instantiate a class. it is a bit difficult to instantiate a class using malloc. I really fail to see what you are asking?
Code:
int* arr = new int[15];
can be just as easily expressed in C as
Code:
int* arr = malloc(15 * sizeof(int));