Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. virtual??

virtual??

Scheduled Pinned Locked Moved The Lounge
c++question
17 Posts 14 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Joel Holdsworth

    Does anyone know why the virtual keyword in C++ has this name? It doesn't seem like a very sensible title for it. There must be some history to it or somthing? Joel Holdsworth

    J Offline
    J Offline
    Jorgen Sigvardsson
    wrote on last edited by
    #8

    I think you should ignore the fact that a virtual method may have a default implementation where it's declared. The function is there (declared) but not there at the same time (not implemented). It's virtually there. :) -- ...Coca Cola, sometimes war...

    J 1 Reply Last reply
    0
    • J Jorgen Sigvardsson

      I think you should ignore the fact that a virtual method may have a default implementation where it's declared. The function is there (declared) but not there at the same time (not implemented). It's virtually there. :) -- ...Coca Cola, sometimes war...

      J Offline
      J Offline
      Joel Holdsworth
      wrote on last edited by
      #9

      Yeah that kinda makes sense... but it still seems a little flimsy. Why not overridable or somthing else... somthing more intuitive. Joel Holdsworth

      R P 2 Replies Last reply
      0
      • J Joel Holdsworth

        Does anyone know why the virtual keyword in C++ has this name? It doesn't seem like a very sensible title for it. There must be some history to it or somthing? Joel Holdsworth

        B Offline
        B Offline
        Bob Stanneveld
        wrote on last edited by
        #10

        From "The C++ programming language" by B. Stroustrup: The word virtual means: "may be redifined later in a class derived from this one."

        A student knows little about a lot. A professor knows a lot about little. I know everything about nothing.

        K 1 Reply Last reply
        0
        • J Joel Holdsworth

          Yeah that kinda makes sense... but it still seems a little flimsy. Why not overridable or somthing else... somthing more intuitive. Joel Holdsworth

          R Offline
          R Offline
          Roger Alsing 0
          wrote on last edited by
          #11

          a friend of a friend *cough* said that that was a vb.net keyword you dont want to include vb keywords into c++ do you? //Roger

          1 Reply Last reply
          0
          • M megaadam

            If you have got a deep interest in the history of C++ the book you should get is "The Design And Evolution of C++" by Stroustrup (father of C++). http://www.amazon.com/exec/obidos/search-handle-url/index%3Dblended%26field-keywords%3Ddesign%252520and%252520evolution%252520c%25252B%25252B%26store-name%3Dall-product-search/102-0180251-2256166 As for virtual allow me to speculate. The Ada programming language that appeared AFAIK before C++ has got a keyword "generic", which might be slightly related to "virtual". :) Adam _____________________________________ Action without thought is not action Action without emotion is not life

            A Offline
            A Offline
            Anthony_Yio
            wrote on last edited by
            #12

            "generic" makes more sense to me though, than "virtual" Sonork 100.41263:Anthony_Yio

            1 Reply Last reply
            0
            • L leppie

              C/C++ C# ==================================== static private virtual abstract Anyways, thats how I understand it. :) top secret xacc-ide 0.0.1

              J Offline
              J Offline
              Jon Hulatt
              wrote on last edited by
              #13

              que? are you saying that static is the same as private, and virtual is the same as abstract?

              #include <beer.h>

              1 Reply Last reply
              0
              • D Daniel Turini

                After you understand virtual, please explain me static :-D Yes, even I am blogging now!

                D Offline
                D Offline
                David Crow
                wrote on last edited by
                #14

                Daniel Turini wrote: please explain me static It simply means "lack of change." Another definition says it "lacks action or movement."


                "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

                1 Reply Last reply
                0
                • B Bob Stanneveld

                  From "The C++ programming language" by B. Stroustrup: The word virtual means: "may be redifined later in a class derived from this one."

                  A student knows little about a lot. A professor knows a lot about little. I know everything about nothing.

                  K Offline
                  K Offline
                  Kastellanos Nikos
                  wrote on last edited by
                  #15

                  Bob Stanneveld wrote: From "The C++ programming language" by B. Stroustrup: The word virtual means: "may be redifined later in a class derived from this one." My "English/C++ lexicon" said the same thing. :cool: - - - - - - - - - - - - - - - - - - Memory leaks is the price we pay \0 01234567890123456789012345678901234

                  1 Reply Last reply
                  0
                  • J Joel Holdsworth

                    Does anyone know why the virtual keyword in C++ has this name? It doesn't seem like a very sensible title for it. There must be some history to it or somthing? Joel Holdsworth

                    P Offline
                    P Offline
                    papaya_zm
                    wrote on last edited by
                    #16

                    virtual is virtual,no reason,no history!

                    1 Reply Last reply
                    0
                    • J Joel Holdsworth

                      Yeah that kinda makes sense... but it still seems a little flimsy. Why not overridable or somthing else... somthing more intuitive. Joel Holdsworth

                      P Offline
                      P Offline
                      palbano
                      wrote on last edited by
                      #17

                      Joel Holdsworth wrote: Why not overridable sorry, overridable is not the same. Joel Holdsworth wrote: somthing more intuitive.

                      public:
                         intuitive void execute()=0;
                      

                      :-D

                      -- signature under construction --

                      -pete

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups