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
    22,304
    You would use the latter if class_obj_name is a pointer.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    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, 11:56 AM
  2. Delegate Calling a method that Calls a delegate.
    By xddxogm3 in forum C# Programming
    Replies: 2
    Last Post: 05-05-2008, 01:59 AM
  3. Calling a Method from Another Class...
    By Dan17 in forum C++ Programming
    Replies: 2
    Last Post: 02-02-2006, 06:31 PM
  4. class method
    By dayknight in forum C++ Programming
    Replies: 5
    Last Post: 04-11-2004, 05:55 PM
  5. class method problem
    By Corey in forum C++ Programming
    Replies: 4
    Last Post: 04-22-2003, 11: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