class method calls

This is a discussion on class method calls within the C++ Programming forums, part of the General Programming Boards category; Hey all. Right now i'm using Code: class_obj_name.method_name(params) to call class methods. I'm just wondering what is the difference between ...

  1. #1
    Registered User
    Join Date
    Jul 2011
    Posts
    62

    class method calls

    Hey all. Right now i'm using
    Code:
    class_obj_name.method_name(params)
    to call class methods. I'm just wondering what is the difference between that and calling it like so:
    Code:
    class_obj_name->method_name(params)
    ?

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    23,773
    You would use the latter if class_obj_name is a pointer.
    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

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. calling a class method within different class method
    By alyeska in forum C++ Programming
    Replies: 5
    Last Post: 03-08-2009, 10:56 AM
  2. Delegate Calling a method that Calls a delegate.
    By xddxogm3 in forum C# Programming
    Replies: 2
    Last Post: 05-05-2008, 12:59 AM
  3. Calling a Method from Another Class...
    By Dan17 in forum C++ Programming
    Replies: 2
    Last Post: 02-02-2006, 05:31 PM
  4. class method
    By dayknight in forum C++ Programming
    Replies: 5
    Last Post: 04-11-2004, 04:55 PM
  5. class method problem
    By Corey in forum C++ Programming
    Replies: 4
    Last Post: 04-22-2003, 10:06 AM

Tags for this Thread


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