Two Questions That've Haunted Me Ever Since I Started C++

This is a discussion on Two Questions That've Haunted Me Ever Since I Started C++ within the C++ Programming forums, part of the General Programming Boards category; These questions have haunted me ever since I started C++. 1.) What EXACTLY is object oriented programming, and what are ...

  1. #1
    Registered User DeanDemon's Avatar
    Join Date
    Nov 2002
    Posts
    37

    Question Two Questions That've Haunted Me Ever Since I Started C++

    These questions have haunted me ever since I started C++.

    1.) What EXACTLY is object oriented programming, and what are the advantages of using it?

    2.) What are some practical uses for C++, and why should I learn it?

    If you can give me some good answers to these questions, you'll make my day.

  2. #2
    Senior Member joshdick's Avatar
    Join Date
    Nov 2002
    Location
    Phildelphia, PA
    Posts
    1,146
    1) OOP is making your code fit your problem rather than trying to fit your problem into the code. In C++, OOP involves writing classes which are like data types.
    One example I've heard several times to demonstrate OOP is that of a bank. An object is just a thing or person. Tellers, customers, accounts, and money are all objects. Each teller can perform a deposit or withdrawl yet they all have different names and employee IDs. Every customer has information like a PIN number which would definitely be put in the private section of the class so that people couldn't see those passwords. Objects of a single class all share certain abilities yet can have different values assigned to them.
    Think about the data types you already know like int. If num1 and num2 are declared as integers, you can do all the mathematical operations on either that you can do, and they can have different values.
    I hope that helped. As for your second question, I'm not entirely sure. I'm a high school senior who's thinking about majoring in Comp Sci, and I'm worried that once I get to college I'll have to learn Java and I will have learned C++ for nothing.
    FAQ

    "The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs." -- Joseph Weizenbaum.

    "If you cannot grok the overall structure of a program while taking a shower, you are not ready to code it." -- Richard Pattis.

  3. #3
    Just a Member ammar's Avatar
    Join Date
    Jun 2002
    Posts
    953
    you can search the web or chack out this link:
    http://www.desy.de/gna/html/cc/Tutorial/tutorial.html
    none...

  4. #4
    booyakasha
    Join Date
    Nov 2002
    Posts
    208
    Originally posted by joshdick
    I'm a high school senior who's thinking about majoring in Comp Sci, and I'm worried that once I get to college I'll have to learn Java and I will have learned C++ for nothing. [/B]
    I'm a Comp Sci Major now and we mainly use C++. I barely used Java at all, when you are doing things such as writing operating systems and such, java is not a very good option.

  5. #5
    moi
    moi is offline
    Registered User moi's Avatar
    Join Date
    Jul 2002
    Posts
    946

    Re: Two Questions That've Haunted Me Ever Since I Started C++

    Originally posted by DeanDemon
    These questions have haunted me ever since I started C++.

    1.) What EXACTLY is object oriented programming, and what are the advantages of using it?

    2.) What are some practical uses for C++, and why should I learn it?

    If you can give me some good answers to these questions, you'll make my day.
    2.) answer: ANYTHING can be written in C++. simple as that. if you see it on your computer, it could have been written in C++, the lone exception being some low level bootstrap and bull**** code.
    hello, internet!

  6. #6
    Registered User datainjector's Avatar
    Join Date
    Mar 2002
    Posts
    356
    programming lang God..Thats all i have to say
    "I wish i could wish my wishs away"

    "By indirections find directions out" -- William Shakespears

    "Do what thou wilt shall be the whole of the law" -- Crowley "THE BEAST 666"

    Mizra -> love = Death...
    RDB(Rocks yooo)..

    http://www.cbeginnersunited.com

    Are you ready for the Trix ???

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. questions....so many questions about random numbers....
    By face_master in forum C++ Programming
    Replies: 2
    Last Post: 07-30-2009, 08:47 AM
  2. Replies: 1
    Last Post: 06-17-2005, 07:29 AM
  3. Float/double compiler error and TONS of questions!
    By musayume in forum C Programming
    Replies: 5
    Last Post: 10-24-2001, 01:40 PM
  4. questions about new and delete
    By Unregistered in forum C++ Programming
    Replies: 7
    Last Post: 09-07-2001, 01:48 PM
  5. questions questions questions.....
    By mfc2themax in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 08-14-2001, 07:22 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21