Thread: Virtual Functions

  1. #1
    Registered User
    Join Date
    Mar 2007
    Posts
    92

    Virtual Functions

    I'm getting the feeling that a virtual function only allows you read data members and you're not able to alter or set them equal to anything in a virtual function. Is this true?

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    No, that's not true. The thing that governs whether you can modify member variables is whether the function is const.

  3. #3
    Registered User
    Join Date
    Mar 2007
    Posts
    92
    Oh, I did make it constant. Thanks!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. i need a good example of virtual functions
    By Anddos in forum C++ Programming
    Replies: 10
    Last Post: 02-15-2006, 11:48 AM
  2. Virtual Functions
    By guda in forum C++ Programming
    Replies: 3
    Last Post: 11-16-2004, 04:13 PM
  3. Thread creation on virtual functions
    By gustavosserra in forum C++ Programming
    Replies: 13
    Last Post: 10-14-2004, 08:03 AM
  4. recursive virtual functions
    By ygfperson in forum C++ Programming
    Replies: 0
    Last Post: 05-25-2003, 08:00 PM
  5. Exporting Object Hierarchies from a DLL
    By andy668 in forum C++ Programming
    Replies: 0
    Last Post: 10-20-2001, 01:26 PM