Toggle navigation
Home
Latest pastes
FAQ
Random
Register
Login
write a C++ program using concept of Pure virtual function.
SUBMITTED BY:
Nrupeshsinh
DATE:
June 26, 2016, 4:08 a.m.
FORMAT:
C++
SIZE:
353 Bytes
Raw
Download
Tweet
HITS:
391
Go to comments
Report
#
include
<iostream.h>
#
include
<conio.h>
#
include
<stdio.h>
class
A
{
public
:
virtual
void
disp
()
=
0
;
};
class
B
:
public
A
{
public
:
void
disp
()
{
cout
<<
"C
\n
"
;
}
virtual
void
show
()
{
cout
<<
"C++
\n
"
;
}
};
void
main
()
{
clrscr
();
B
bobj
;
B
*
ptr
;
ptr
=&
bobj
;
ptr
->
disp
();
ptr
->
show
();
getch
();
}
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus