Pure Virtual Function

Pure Virtual Function

Pure Virtual Function
Ganesh
Thursday 16 March 2017

Pure Virtual Function -

เค…เค—เคฐ เคนเคฎ base class เคฎें เค•िเคธी function เค•ो define เค•เคฐे เคคเคฅा เค‰เคธเค•ी เคชुเคจः definition derived class เคฎें เคฆी เคœाเคฏे เคคो base class เค•ा เคตเคน function do-nothing เคช्เคฐเค•ाเคฐ เค•ा เคนै, เค‡เคธ เคช्เคฐเค•ाเคฐ เค•े function เค•ो Pure Virtual Function เค•เคนा เคœाเคคा เคนै เคคเคฅा เคเคธी classes เคœिเคจเคฎें Pure Virtual Function เคฌเคจा เคนो Abstract Class เค•เคนเคฒाเคคी เคนै।

//virtual void display()=0;


Example-
class fruit      //base class
{
//virtual void display()=0;
}
class apple : public fruit  // abstract class
{
void display()
{
Cout<<"this is a Pure Virtual Function";
}
}



Open Comments
Close comment

1 comment