Click here to Skip to main content
15,923,168 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: size of class Pin
santhosh-padamatinti18-Sep-09 0:25
santhosh-padamatinti18-Sep-09 0:25 
QuestionVC8 source code editor Pin
uli200017-Sep-09 22:56
uli200017-Sep-09 22:56 
AnswerRe: VC8 source code editor Pin
Naveen17-Sep-09 22:59
Naveen17-Sep-09 22:59 
Questionbeginner question Pin
Game-point17-Sep-09 22:44
Game-point17-Sep-09 22:44 
AnswerRe: beginner question Pin
CPallini17-Sep-09 22:48
mveCPallini17-Sep-09 22:48 
AnswerRe: beginner question Pin
Rajesh R Subramanian17-Sep-09 22:55
professionalRajesh R Subramanian17-Sep-09 22:55 
AnswerRe: beginner question Pin
«_Superman_»17-Sep-09 23:57
professional«_Superman_»17-Sep-09 23:57 
AnswerRe: beginner question Pin
santhosh-padamatinti18-Sep-09 0:36
santhosh-padamatinti18-Sep-09 0:36 
AnswerRe: beginner question Pin
Anil Kumar.Arvapalli18-Sep-09 1:40
Anil Kumar.Arvapalli18-Sep-09 1:40 
Questionhow to read/write long long ... integer from database? Pin
includeh1017-Sep-09 21:39
includeh1017-Sep-09 21:39 
AnswerRe: how to read/write long long ... integer from database? Pin
KarstenK17-Sep-09 21:47
mveKarstenK17-Sep-09 21:47 
AnswerRe: how to read/write long long ... integer from database? [modified] Pin
Saurabh.Garg17-Sep-09 23:31
Saurabh.Garg17-Sep-09 23:31 
Questionpure virtual functions [modified] Pin
hrishiS17-Sep-09 20:36
hrishiS17-Sep-09 20:36 
AnswerRe: pure virtual functions Pin
CPallini17-Sep-09 20:40
mveCPallini17-Sep-09 20:40 
GeneralRe: pure virtual functions Pin
hrishiS17-Sep-09 20:46
hrishiS17-Sep-09 20:46 
GeneralRe: pure virtual functions Pin
Stuart Dootson17-Sep-09 20:58
professionalStuart Dootson17-Sep-09 20:58 
GeneralRe: pure virtual functions Pin
hrishiS17-Sep-09 21:23
hrishiS17-Sep-09 21:23 
GeneralRe: pure virtual functions Pin
Stuart Dootson17-Sep-09 21:50
professionalStuart Dootson17-Sep-09 21:50 
GeneralRe: pure virtual functions Pin
hrishiS17-Sep-09 21:33
hrishiS17-Sep-09 21:33 
GeneralRe: pure virtual functions Pin
Stuart Dootson17-Sep-09 21:45
professionalStuart Dootson17-Sep-09 21:45 
GeneralRe: pure virtual functions Pin
hrishiS17-Sep-09 22:25
hrishiS17-Sep-09 22:25 
GeneralRe: pure virtual functions Pin
Cedric Moonen17-Sep-09 21:00
Cedric Moonen17-Sep-09 21:00 
hrishiS wrote:
But there is always a small difference between the abstract class and interface.


An interface is a concept that is taken from other programing languages that natively supports interfaces: an interface simply describes the public method of an object, but doesn't have any functionality. This object should then be implemented by a class which inherits from the interface.
So, it means that the interface only contains pure virtual functions (and no data member).

An abstract class on the other hand is a class that cannot be instanciated directly, so you need to inherit from it. To make a class abstract, it needs to contain at least one pure virtual function (but it can contain other functions and also data members).


hrishiS wrote:
Anyway, when we talk about interface also, when do we need/use them exactly?Could you please give me a practical example.


If you really want to implement the concept of an interface, then you need to use pure virtual functions for every function of the interface, because the interface cannot contain any funcitonality. All the functions from the interface are pure virtual functions.

Cédric Moonen
Software developer

Charting control [v2.0]
OpenGL game tutorial in C++

AnswerRe: pure virtual functions Pin
Kushagra Tiwari17-Sep-09 20:44
Kushagra Tiwari17-Sep-09 20:44 
GeneralRe: pure virtual functions Pin
Cedric Moonen17-Sep-09 20:53
Cedric Moonen17-Sep-09 20:53 
GeneralRe: pure virtual functions Pin
hrishiS17-Sep-09 20:55
hrishiS17-Sep-09 20:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.