virtual function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sunny3
    New Member
    • Sep 2007
    • 6

    virtual function

    Answer plz..........In C++ application virtual function is used. Assume if C++ stops supporting virtual functions, what changes need to be made in the application?
  • Ganon11
    Recognized Expert Specialist
    • Oct 2006
    • 3651

    #2
    Well, what would change in your application if virtual didn't work? Obviously, the first step would be to remove the 'virtual' keyword from your files, but what next? How could you gain back the functionality of virtual without actually using virtual?

    Comment

    • vinot85
      New Member
      • Aug 2007
      • 53

      #3
      Hi buddy,
      Obviously we need to change the virtual keyword first. But how we can achieve the Run time polymrphism is to use Function pointers in C Style.
      I think this may work.Im not sure...

      Regards,
      Vinoth

      Comment

      • weaknessforcats
        Recognized Expert Expert
        • Mar 2007
        • 9214

        #4
        Originally posted by sunny3
        Answer plz..........In C++ application virtual function is used. Assume if C++ stops supporting virtual functions, what changes need to be made in the application?
        Virtual functions are part of the ANSI C++ language and cannot be removed.

        Conside that of you remove the virtual keyword you could also remove any, or all, of the keywords. The result would be not usable.

        Comment

        • mschenkelberg
          New Member
          • Jun 2007
          • 44

          #5
          build your own vtable!

          Comment

          • weaknessforcats
            Recognized Expert Expert
            • Mar 2007
            • 9214

            #6
            Originally posted by mschenkelberg
            build your own vtable!
            Actually, that isn't that hard. You just need to decide whether to spend your life creating a personal system as opposed to using one that's already been automated and has been established as a ANSI standard.

            Comment

            Working...