what features make better C++ from C?
Why many programs that were used in C, do not work in C++?
any more features.. please give me details. i need to make a essay about it.
what features make better C++ from C?
Why many programs that were used in C, do not work in C++?
any more features.. please give me details. i need to make a essay about it.
Last edited by moenia; 04-29-2002 at 01:48 PM.
What makes C++ better than C is that a struct/class can have member functions as well as member data.Originally posted by moenia
what features make better C++ from C?
Why many programs that were used in C, do not work in C++?
any more features.. please give me details. i need to make a essay about it.
Many programs written in C can directly map to C++, just move the variables and functions into a C++ class/struct.
I think this would be best answered by: http://www.cprogramming.com/cboard/s...&threadid=5352
there are some details that that thread doesn't cover.
there is object oriented programming. c provides structs to organize a group of variables into a coherent block. c++ provides classes to make that coherent block self-dependant, work well with other blocks, derive details from base classes, and have the general look to programmers of an object meant for a specific task.
and then there are details:
- some optional but recommended features of c are required in c++, like function prototypes.
- c++ uses stream input/output to make life easier. (or in my case, harder). c requires a weird syntax to get that level of flexibility.
- c++ has vector arrays and string classes. the string class is a flexible version of c strings. it can be incremented, inserted, searched, or deleted at will without the need for extra garbage collection (on the programmers part). vector arrays are arrays of anything, but these arrays can be incremented, deleted, sorted, searched, etc... do a search on stl to find out more.
- c++ has less need for defines. i forget why, but it has something to do with const variables...
- c++ has a more flexible syntax:
wouldn't be allowed in C. neither would this(in some cases):Code:for (int i=0;i<8;i++)
Code:int c=3;
there's probably other stuff too, why not ask more detailed questions?
Last edited by ygfperson; 04-29-2002 at 07:30 PM.
howdy,
read "The Design and Evolution of C++" by Bjarne Strostrup ISBN0-201-54330-3...
it kind of reads like a dictionary but my feeble mind loved every minute of it
M.R.
I don't like you very much. Please post a lot less.
Cheez
*and then*
No, I know you were joking. My point still stands.