Functions in a Class Structure?

This is a discussion on Functions in a Class Structure? within the C++ Programming forums, part of the General Programming Boards category; the name says it all can you build a function inside a class and then initiate it from main or ...

  1. #1
    Fallen AndyBomstad's Avatar
    Join Date
    Jan 2005
    Posts
    52

    Functions in a Class Structure?

    the name says it all

    can you build a function inside a class and then initiate it from main or another location?

  2. #2
    Registered User
    Join Date
    Apr 2003
    Posts
    2,662
    can you build a function inside a class
    Classes contain member variables and member functions.

    ...and then initiate it from main or another location?
    You "execute" functions and "instantiate" objects of a class.
    Last edited by 7stud; 06-15-2005 at 05:26 AM.

  3. #3
    Registered User
    Join Date
    Sep 2004
    Posts
    719
    you can use only class methods (functions inside a class) from outside of the class if A) the method is public, B) the object (class instance) is within the scope of the calling function.
    i seem to have GCC 3.3.4
    But how do i start it?
    I dont have a menu for it or anything.

  4. #4
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Static member functions may be called without an instance of the object.


    Quzah.
    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Abstract class (IDispatch) in a C structure
    By Overlord in forum Windows Programming
    Replies: 4
    Last Post: 12-31-2008, 08:38 AM
  2. Replies: 7
    Last Post: 11-17-2008, 01:00 PM
  3. Read-only class members
    By kidburla in forum C++ Programming
    Replies: 4
    Last Post: 10-14-2006, 01:52 PM
  4. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 07:39 AM
  5. Warnings, warnings, warnings?
    By spentdome in forum C Programming
    Replies: 25
    Last Post: 05-27-2002, 07:49 PM

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