Go Back   CodingForums.com > :: Computing & Sciences > Computer Programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-15-2012, 07:35 AM   PM User | #1
plasticsinfo
New to the CF scene

 
Join Date: Dec 2012
Posts: 4
Thanks: 10
Thanked 0 Times in 0 Posts
plasticsinfo is an unknown quantity at this point
Post What is use of Oops in C++?

Hii, friends ..good morning.
What is use of Oops(Object Oriented Programming) in C++?
plasticsinfo is offline   Reply With Quote
Old 12-15-2012, 07:49 PM   PM User | #2
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,451
Thanks: 0
Thanked 496 Times in 488 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
Quote:
Originally Posted by plasticsinfo View Post
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.
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is online now   Reply With Quote
Users who have thanked felgall for this post:
plasticsinfo (01-12-2013)
Old 12-17-2012, 06:55 AM   PM User | #3
misteroram01
New Coder

 
Join Date: Sep 2012
Posts: 13
Thanks: 0
Thanked 2 Times in 2 Posts
misteroram01 is an unknown quantity at this point
OOPs is all about C++
misteroram01 is offline   Reply With Quote
Users who have thanked misteroram01 for this post:
plasticsinfo (01-12-2013)
Old 12-28-2012, 05:18 AM   PM User | #4
bparker1084
New to the CF scene

 
Join Date: Oct 2012
Location: San Jose
Posts: 9
Thanks: 0
Thanked 2 Times in 2 Posts
bparker1084 is an unknown quantity at this point
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/.
bparker1084 is offline   Reply With Quote
Users who have thanked bparker1084 for this post:
plasticsinfo (01-12-2013)
Old 01-13-2013, 03:46 AM   PM User | #5
negative zero
New to the CF scene

 
Join Date: Jan 2013
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
negative zero is an unknown quantity at this point
Quote:
Originally Posted by felgall View Post
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.

Quote:
Originally Posted by felgall
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...

Quote:
Originally Posted by felgall
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.
Quote:
Originally Posted by Seb
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.

Last edited by negative zero; 01-13-2013 at 05:58 AM..
negative zero is offline   Reply With Quote
Old 01-15-2013, 02:50 PM   PM User | #6
ahamadhussain
New to the CF scene

 
Join Date: Jan 2013
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
ahamadhussain is an unknown quantity at this point
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..
ahamadhussain is offline   Reply With Quote
Old 01-18-2013, 12:39 PM   PM User | #7
martinwhisely
New to the CF scene

 
Join Date: Mar 2012
Location: Living in New York
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
martinwhisely is an unknown quantity at this point
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.
martinwhisely is offline   Reply With Quote
Old 02-02-2013, 07:23 AM   PM User | #8
ggiwebsinfo
New to the CF scene

 
Join Date: Sep 2012
Location: Ludhiana, Punjab, India
Posts: 7
Thanks: 0
Thanked 2 Times in 2 Posts
ggiwebsinfo is an unknown quantity at this point
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..
ggiwebsinfo is offline   Reply With Quote
Old 02-03-2013, 11:52 PM   PM User | #9
negative zero
New to the CF scene

 
Join Date: Jan 2013
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
negative zero is an unknown quantity at this point
@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?
negative zero is offline   Reply With Quote
Old 02-06-2013, 09:59 AM   PM User | #10
Rexsrambo
New to the CF scene

 
Join Date: Feb 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Rexsrambo is an unknown quantity at this point
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.
Rexsrambo is offline   Reply With Quote
Old 02-06-2013, 02:36 PM   PM User | #11
jerry62704
Senior Coder

 
jerry62704's Avatar
 
Join Date: Oct 2007
Location: Springfield, IL
Posts: 1,046
Thanks: 9
Thanked 81 Times in 81 Posts
jerry62704 is on a distinguished road
bparker, I tried that URL and it came back as lacking the userid.
__________________
.
.
...and gladly would he learn and gladly teach

Visit www.LiberalsWin.com for humor and the unique Bush/Obama Approval Polls
jerry62704 is offline   Reply With Quote
Old 02-14-2013, 11:46 AM   PM User | #12
pavitrabalse07
New Coder

 
Join Date: Jan 2013
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
pavitrabalse07 is an unknown quantity at this point
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.
pavitrabalse07 is offline   Reply With Quote
Old 03-18-2013, 06:19 AM   PM User | #13
nazirbhatt
New to the CF scene

 
Join Date: Feb 2013
Location: Karachi sindh in Pakistan
Posts: 5
Thanks: 3
Thanked 0 Times in 0 Posts
nazirbhatt is an unknown quantity at this point
oops is Object oriented programming system (C++). It is base of every programming language.
nazirbhatt is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:23 PM.


Advertisement
Log in to turn off these ads.