Thread: C++ is an object oriented language but...

  1. #1
    Registered User
    Join Date
    Jun 2010
    Posts
    10

    C++ is an object oriented language but...

    I see there's an object oriented version of C? Where'd that come from and what benefits does it have over C++??

    http://www.planetpdf.com/codecuts/pdfs/ooc.pdf
    Last edited by Salem; 07-13-2010 at 01:28 AM. Reason: URL fixed

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by m&m
    WI see there's an object oriented version of C? Where'd that come from and what benefits does it have over C++??
    You should read the article yourself. As for benefits: if you have access to a C compiler, but not a C++ (or other language for which OO is a common paradigm) compiler, and want to use object oriented programming, then knowing how to apply object oriented techniques in C would be useful.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,318
    Quote Originally Posted by m&m View Post
    benefits ... over C++??
    What, never!

    I wonder if the fact that you posted a dead link is meant to somehow be symbolic here
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by iMalc
    I wonder if the fact that you posted a dead link is meant to somehow be symbolic here
    Change the ampersand to a question mark, or entirely remove what was supposed to be the query string.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  5. #5
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    The apparently "fixed" URL still doesn't work.
    Obj-C is kind of an alien language, too. It follows not the syntax of C, which C++ extends to OOP.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  6. #6
    Registered User
    Join Date
    Jan 2009
    Posts
    1,485
    Actually it does, legal C is legal Obj-C.

  7. #7
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    I didn't say wouldn't work. But look at some Obj-C code and it looks kindof alien to a C programmer. Hence my remark on how it didn't follow the syntax of C.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  8. #8
    Registered User
    Join Date
    Jan 2009
    Posts
    1,485
    Ok I agree, it certainly looks more like regular C, than Obj-C does.

  9. #9
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    The correct link: Object-oriented Programming with ANSI-C. It is the somewhat well known book on the topic. It is not about Objective-C.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  10. #10
    Software engineer
    Join Date
    Aug 2005
    Location
    Oregon
    Posts
    283
    Looks like another book I'll have to read

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. object oriented programming
    By l2u in forum C++ Programming
    Replies: 10
    Last Post: 11-06-2006, 10:18 AM
  2. Object Oriented Project
    By logicwonder in forum C++ Programming
    Replies: 2
    Last Post: 06-16-2006, 06:29 AM
  3. Replies: 60
    Last Post: 12-20-2005, 11:36 PM
  4. Question on l-values.
    By Hulag in forum C++ Programming
    Replies: 6
    Last Post: 10-13-2005, 04:33 PM
  5. Object Oriented - Funny story
    By MethodMan in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 09-26-2002, 02:21 PM