tomplusplus wrote: |
---|
although it cant store functions isnt this basic opject oriented programming?
I am new to c so this may be a stupid question. |
In C++, the only difference between a struct and a class, is that the struct defaults to public access, whereas a class defaults to private - (where no access type is specified). So structs can indeed have constructors, destructors, member functions, virtual functions & inheritance etc.
Have a read of the tutorial at the top left of this page, there is lots of info in the reference section as well, plus the articles.
EDIT: Stupid questions are when people don't learn from their mistakes - simple question are OK, remember that everyone has to start from somewhere. People are happy to help anyone from any level, as long there is some effort shown (which you have)
Canis lupus wrote: |
---|
It is not an object oriented language per se but you can use it in an object oriented way. |
Would it be clearer to say that C++ is not as "pure OOP" as some other languages like Eiffel or D say? I have the impression that C++ has
most nearly all of the features of OOP, there are only a few that it doesn't have.
Not trying to be pedantic, but the OP is a beginner - may be it is better not to leave the impression that "C++ is not really a OOP language".
Hope all is well at your end :+)