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. General Programming
  3. C / C++ / MFC
  4. function header = 0

function header = 0

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 Posts 4 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 Offline
    J Offline
    Jay03
    wrote on last edited by
    #1

    virtual void empty() = 0; // fucntion header Why is this function header assigned a value of zero? Is this suppose to mean its a pure virtual function from a derived class with no implementation in it? like this: virtual void empty() { // empty } Thanks, Jay :confused:

    V M 2 Replies Last reply
    0
    • J Jay03

      virtual void empty() = 0; // fucntion header Why is this function header assigned a value of zero? Is this suppose to mean its a pure virtual function from a derived class with no implementation in it? like this: virtual void empty() { // empty } Thanks, Jay :confused:

      V Offline
      V Offline
      valikac
      wrote on last edited by
      #2

      definitely Kuphryn

      J 1 Reply Last reply
      0
      • V valikac

        definitely Kuphryn

        J Offline
        J Offline
        Jay03
        wrote on last edited by
        #3

        Which functions usually have an empty implementation.... is it the Base Class or the Derived Class?

        A 1 Reply Last reply
        0
        • J Jay03

          Which functions usually have an empty implementation.... is it the Base Class or the Derived Class?

          A Offline
          A Offline
          Alex_Y
          wrote on last edited by
          #4

          Base class CBase //abstract class { virtual int Pure(int nA) = 0; } class CDerive : public CBase { virtual Pure(int nA) { return nA+1; } }

          :)

          1 Reply Last reply
          0
          • J Jay03

            virtual void empty() = 0; // fucntion header Why is this function header assigned a value of zero? Is this suppose to mean its a pure virtual function from a derived class with no implementation in it? like this: virtual void empty() { // empty } Thanks, Jay :confused:

            M Offline
            M Offline
            markkuk
            wrote on last edited by
            #5

            Yes, it means it's a pure virtual function with no implementation. That's not the same as a function whose implementation has an empty body.

            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