Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 13 of 13
  1. #1
    New to the CF scene
    Join Date
    Dec 2012
    Posts
    4
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Post What is use of Oops in C++?

    Hii, friends ..good morning.
    What is use of Oops(Object Oriented Programming) in C++?

  • #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,592
    Thanks
    0
    Thanked 645 Times in 635 Posts
    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/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • Users who have thanked felgall for this post:

    plasticsinfo (01-12-2013)

  • #3
    New Coder
    Join Date
    Sep 2012
    Posts
    13
    Thanks
    0
    Thanked 2 Times in 2 Posts
    OOPs is all about C++

  • Users who have thanked misteroram01 for this post:

    plasticsinfo (01-12-2013)

  • #4
    New to the CF scene
    Join Date
    Oct 2012
    Location
    San Jose
    Posts
    9
    Thanks
    0
    Thanked 2 Times in 2 Posts
    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/.

  • Users who have thanked bparker1084 for this post:

    plasticsinfo (01-12-2013)

  • #5
    New to the CF scene
    Join Date
    Jan 2013
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #6
    New to the CF scene
    Join Date
    Jan 2013
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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..

  • #7
    New to the CF scene
    Join Date
    Mar 2012
    Location
    Living in New York
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #8
    New to the CF scene
    Join Date
    Sep 2012
    Location
    Ludhiana, Punjab, India
    Posts
    7
    Thanks
    0
    Thanked 2 Times in 2 Posts
    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..

  • #9
    New to the CF scene
    Join Date
    Jan 2013
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    @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?

  • #10
    New to the CF scene
    Join Date
    Feb 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #11
    Senior Coder jerry62704's Avatar
    Join Date
    Oct 2007
    Location
    Springfield, IL
    Posts
    1,100
    Thanks
    13
    Thanked 87 Times in 87 Posts
    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

  • #12
    New Coder
    Join Date
    Jan 2013
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #13
    New to the CF scene
    Join Date
    Feb 2013
    Location
    Karachi sindh in Pakistan
    Posts
    5
    Thanks
    3
    Thanked 0 Times in 0 Posts
    oops is Object oriented programming system (C++). It is base of every programming language.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •