...

View Full Version : What is use of Oops in C++?



plasticsinfo
12-15-2012, 07:35 AM
Hii, friends ..good morning.
What is use of Oops(Object Oriented Programming) in C++?

felgall
12-15-2012, 07:49 PM
Hii, friends ..good morning.
What is use of Oops(Object Oriented Programming) in C++?

That is what C++ is all about. You use it to do object oriented programming.

If you just wanted to write procedural programs then you would use C rather than C++ because C++ is C with the additions needed to be able to write OOP.

The advantages to writing OOP with C++ are the same as writing OOP in any other programming language - it makes it easier to break big programs up into manageable sections and to reuse code in multiple programs - by defining objects that not only contain all of the data associated with a particular object but also all the code to handle all the different things you can do with that object.

misteroram01
12-17-2012, 06:55 AM
OOPs is all about C++

bparker1084
12-28-2012, 05:18 AM
If you're a complete beginner, I suggest you read one of the hundreds of C++ tutorials lying around on the internet. A good place to start would be http://www.programmingtutorials.com/.

negative zero
01-13-2013, 03:46 AM
That is what C++ is all about. You use it to do object oriented programming.
It is impossible for a programming language to be purely object oriented, because object orientation is an abstract of the data structures. Data structures aren't the only language features of a programming language required to express algorithms. Consider while and for loops, which are procedural elements. C++ also has lambdas, which are functional elements.


If you just wanted to write procedural programs then you would use C rather than C++ because C++ is C with the additions needed to be able to write OOP.
... Unless you wanted the other features that C++ offers, eg. lambdas, static typing, smart pointers, exceptions, reference types, etc.

C++ is not an extension of C. That may have been true in 1985, but since then there have been numerous features added to both programming languages that haven't been synchronised, some of which clash. For example, C uses a less static type safety than C++. The modulo operator isn't required to behave identically when handling a negative denominator. In C++, sizeof 'a' is 1 where in C, sizeof 'a' is sizeof (int). C has the addition of variable length arrays and flexible array members which C++ doesn't have. The list goes on...


The advantages to writing OOP with C++ are the same as writing OOP in any other programming language - it makes it easier to break big programs up into manageable sections and to reuse code in multiple programs - by defining objects that not only contain all of the data associated with a particular object but also all the code to handle all the different things you can do with that object.
Have you ever studied the Liskov Substitution Principle? I would suggest that proper OOP is quite a restrictive form of abstaction.

As for an answer to this question, I'll quote a user from another forum. Rest assure I have permission to do so.

Object orientation is an abstraction. Consider the definition of car, which is a category that consists of all things with four wheels, gears, an engine and a steering wheel, among other things. This is an abstract definition of a car.

The "car" might define a method called "stear" or "turn", which is an action if you like, that an instance of a car can perform to change it's own direction or bearing. According to Liskov substitution principle, it would be incorrect to define a "drive" method in "car" because manuals drive differently to automatics.

By inheritance, derivations such as "automatic car" and "manual car" can be defined to re-use and extend the properties of the "car". The two extensions can then implement their own "drive" or "accelerate" methods, etc. Other projects can then reuse these implementations. That's the idea behind abstraction.

One of the only things that the community of OOP programmers can agree upon is that any code that uses "car" correctly should be able to use "automatic car" and "manual car" in it's place without any problems or differences in functionality. ...

The rest of the post assumes lack of specifics regarding the language. I won't provide further specifics regarding C++, because this is a pretty good answer to your question. If you have more questions, feel free to ask them.

ahamadhussain
01-15-2013, 02:50 PM
Hi..
The oop is to create an object,It's a properties and methods.while designing c++ modules, we try to see the whole world in the form objects. For example Bus is an object which has certain properrites such as color, numbero of doors.etc., it also has certain methods such as accelerate,breke,and so on..

martinwhisely
01-18-2013, 12:39 PM
OOPS is now used into all the programming language. It really understandable language to program or develop a software. When I was a beginner stage of learning the programming, then I love to prefer mostly the OOPS with using C++ into the Turbo C++ IDE.

ggiwebsinfo
02-02-2013, 07:23 AM
It's all about C++. If you want to know about Oops then must read theatrical portion of C++ after that you can fully understand..

negative zero
02-03-2013, 11:52 PM
@martinwhisely Which part of Haskell uses object orientation?
@ggiwebsinfo I'd be very interested in the theatrical portion of C++. Are the actors very well known?

Rexsrambo
02-06-2013, 09:59 AM
C++ is called oops because the variable. We create are called objects, and the program is fully depend on the object. A Compiler is that which is used to compile the program and transfers the user defined language to computer language.

jerry62704
02-06-2013, 02:36 PM
bparker, I tried that URL and it came back as lacking the userid.

pavitrabalse07
02-14-2013, 11:46 AM
Object oriented programming is method of programming where a system is considered as a collection of objects that interact together to accomplish certain tasks. Objects are entities that encapsulate data and procedures that operate on the data.

nazirbhatt
03-18-2013, 06:19 AM
oops is Object oriented programming system (C++). It is base of every programming language.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum