need help in OOP

totally new in OOP,any professional tutor here can guide me or teach me?
Hi mike ,
The simpler way to learn C++ is master in struct topic of C programming . In C++ you can write functions inside struct. Don't go for classes topic directly . Dont hesitate to ask any questions
http://www.cplusplus.com/articles/jEywvCM9/
Last edited on
Bhavith wrote:
The simpler way to learn C++ is master in struct topic of C programming . In C++ you can write functions inside struct. Don't go for classes topic directly


But class and struct are almost Identical. There are millions of examples out there, just learn it properly.

http://www.cplusplus.com/doc/tutorial/classes/
i dont understand virtual in inheritance,can anyone teach me?
These are google-type questions. just have a search. For example, this is a good example of inheritance and the virtual keyword:
http://www.tutorialspoint.com/cplusplus/cpp_polymorphism.htm
Do you mean virtual functions, or virtual inheritance?

http://www.cplusplus.com/doc/tutorial/polymorphism/


Google and wiki are your best friends :+)
those all virtual things,i dont want drag already lah,brother u can save my life or not
if you want to know what is virtual and how it works first master in polymorphism .
in simple manner polymorphism means a single entity can perform different operation .

example : Assume yourself as one function
Below is example for compile time polymorphism using function overloading
1
2
3
4
5
6
7
8
void mike9407( string sTV)
{
  cout << " I am watching TV"  << endl;
}
void mike9407( string sTV, int iRemote)
{
 cout << "I am watching TV also I can change channel because I have remote " << endl;
}

In polymorphism we have compile time and run time polymorphism . what ever you are asking it will come under run time . I can't explain full details . If you have any questions ask
you are still procedural programming and not using OOP if you just use functions.
functions are not objects. and a class is NOT identical to a struct. Objects manipulate their own values if you manipulate them you are not object oriented programming. it requires a different type of thinking, you guys are talking about writing logic to deal with the data - that is procedural programming.

a class has methods and fields which fields work as variables and methods like modules. and objects are created from them so in no way is a struct identical to a class. structs deal with structured programming not oop.


inheritance is what one object can pass to another - once again something you shouldn't do(the objects do it - objects looks for things with out even know what they are looking for because its super fast- it gets weird). i think of it as bugs, and you have a base bug - then legged bugs which have everything base bugs have plus legs, then winged bugs have everything legged bugs have plus wings. like what bhavith wrote - thats actually more like inheritance since those are separate functions (but not objects)

see objects have data and everything required to manipulate data including functions(methods).
you arn't supossed to see the data thats actually called, data hiding and encapsulation.

if you want to learn oop i highly suggest learning structured programming first because oop gets pretty advanced pretty quick - just look at how text messaging, phone calls, or searching on google works
Last edited on
you are still procedural programming and not using OOP if you just use functions.
functions are not objects.

Sure they are.


and a class is NOT identical to a struct.

Technically, they're not identical, but for practical purposes, they may as well be.


it requires a different type of thinking, you guys are talking about writing logic to deal with the data - that is procedural programming.

Right. There is no data or logic in OOP. Just go crazy.


a class has methods and fields which fields work as variables and methods like modules. and objects are created from them so in no way is a struct identical to a class. structs deal with structured programming not oop.

I surely don't know what "methods like modules" or fields that "work as variables" are, but structs can have both data members and member functions at varying levels of access, just like classes can.


see objects have data and everything required to manipulate data including functions(methods).
you arn't supossed to see the data thats actually called, data hiding and encapsulation.

You finally said something that makes some sense. ;)
Last edited on
Topic archived. No new replies allowed.