What is class?
Printable View
What is class?
not so sure
A class is an object that contains items of data as well as operations/functions that can be performed on that data.
boogal1
aaa
Both registered today, both with 1 post each and the reply posted only minutes after the original post. Is this a case of multiple personalities? or simply someone as bored as me with nothing better to do?
LOL, I think you are right. He wanted to increase the post count for both of his users;0:DQuote:
Originally posted by Fishcake
boogal1
aaa
Both registered today, Is this a case of multiple personalities?
Sounds familiar, doesn't it?Quote:
Originally posted by abdul
LOL, I think you are right. He wanted to increase the post count for both of his users;0:D
A class is a type of object, defining its contents and methods related to it, a class is the fundamental part of a paradigm called Object Oriented Programming (OOP) which allows data to be encapsulated and protected from misusage, furthermore object orientation provides inheritance which means grouping classes into a hierarchic structure and polymorphism which means that objects can act in many ways by inheriting special abstract forms. It's very important to learn OOP at an early stage in C++ since you'll be depending on it to produce applications efficiently.
Check out the tutorials at the top of this forum
kedaman,
by using structures in an early stage of learning c++ & OOP, do you easier understand classes later?
Isn't structures quite like classes in some ways?
I don't know........
thanks
Classes and Structures are related to each other but in their basic stages. It means that structure is like a record that can hold different types of information. Other the other hand, a class is a record and also an object that can hold different kinds of information (properties) and it can also have some actions (functions) for its object. So, a class is kinda like an advanced and different structure.Quote:
Originally posted by [praetorian]
kedaman,
by using structures in an early stage of learning c++ & OOP, do you easier understand classes later?
Isn't structures quite like classes in some ways?
I don't know........
thanks
Ok, then I understand better.
thanks
;)
In C++, a struct is simply a class where all the members are public by default (rather than private as in a class).
which already shows just how nearly related they are...
Yep, but they're implemented differently, so you need to be careful when crossing languages (C & C++).
No, I think you should go straight on with OOP instead of getting used to functional programming which leaves you with polluted paradigms, a sign that you have missunderstood the use of C++ is that you have global variables and functions around and poorly encapsulated classes, and hardly any abstraction.Quote:
Originally posted by [praetorian]
kedaman,
by using structures in an early stage of learning c++ & OOP, do you easier understand classes later?
Isn't structures quite like classes in some ways?
I don't know........
thanks