Click here to Skip to main content
16,004,919 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: pointer to char array Pin
ThatsAlok22-Sep-05 23:21
ThatsAlok22-Sep-05 23:21 
GeneralRe: pointer to char array Pin
Steen Krogsgaard22-Sep-05 23:23
Steen Krogsgaard22-Sep-05 23:23 
GeneralRe: pointer to char array Pin
ThatsAlok22-Sep-05 23:47
ThatsAlok22-Sep-05 23:47 
Questionwhy pure virtual function is needed Pin
aloktambi22-Sep-05 19:54
aloktambi22-Sep-05 19:54 
AnswerRe: why pure virtual function is needed Pin
Cedric Moonen22-Sep-05 20:04
Cedric Moonen22-Sep-05 20:04 
GeneralRe: why pure virtual function is needed Pin
Roger Stoltz22-Sep-05 21:16
Roger Stoltz22-Sep-05 21:16 
AnswerRe: why pure virtual function is needed Pin
Rick York22-Sep-05 21:00
mveRick York22-Sep-05 21:00 
AnswerRe: why pure virtual function is needed Pin
MailtoGops22-Sep-05 21:16
MailtoGops22-Sep-05 21:16 
cedric moonen is right...

Here Why you need Abstract class..

Consider the basic senario of having shape classes like Line, Rectangle, etc.

In the real world, there is nothing called Shape... you cannot define a Shape,, The object could be regular, irregular... But you cannot not define Shape anywhere...

Line is a Shape
Circle is a Shape
Rectangle is a Shape
But Shape is not Shape... (U might confused more..if it is i am really sorry Smile | :) )

But if you look at Line, Circle, Rectangle they are measarable..ie you can find area, they will have line length, width, color, style etc.. So considering these features we have, all are put in to a Shape class in order to resuse the existing implementation...

But as I told Shape is not Shape... You cannot draw a Shape.. So you need to protect the user to create Shape object...For that you need to make that class as abstract ie it must to have a pure virtual function,

Pure virtual function doesn't has implementation (In c++ context)








" Action without vision is only passing time,
Vision without action is merely day dreaming,
But vision with action can change the world "

- Words from Nelson Mandela

Thanks & Regards,

Gopalakrishnan
AnswerRe: why pure virtual function is needed Pin
vikas amin23-Sep-05 2:12
vikas amin23-Sep-05 2:12 
Questionpointer to char array Pin
Rupali sarda22-Sep-05 19:48
Rupali sarda22-Sep-05 19:48 
AnswerRe: pointer to char array Pin
Calc2022-Sep-05 19:59
Calc2022-Sep-05 19:59 
AnswerRe: pointer to char array Pin
Cedric Moonen22-Sep-05 20:05
Cedric Moonen22-Sep-05 20:05 
AnswerRe: pointer to char array Pin
sunit522-Sep-05 20:12
sunit522-Sep-05 20:12 
AnswerRe: pointer to char array Pin
ThatsAlok22-Sep-05 22:52
ThatsAlok22-Sep-05 22:52 
GeneralRe: pointer to char array Pin
Eytukan22-Sep-05 23:03
Eytukan22-Sep-05 23:03 
QuestionHOW TO OVERRIDE SINGLE CLICK MESSAGE FOR AN EDIT BOX. Pin
rajeev8222-Sep-05 19:39
rajeev8222-Sep-05 19:39 
AnswerRe: HOW TO OVERRIDE SINGLE CLICK MESSAGE FOR AN EDIT BOX. Pin
Calc2022-Sep-05 19:56
Calc2022-Sep-05 19:56 
QuestionProcess Synchronization Pin
Steve Chang22-Sep-05 19:25
Steve Chang22-Sep-05 19:25 
QuestionVMR Sample compile error Pin
Cindy197822-Sep-05 18:36
Cindy197822-Sep-05 18:36 
QuestionAbout how to change paper size when you are about to print Pin
lionheart16322-Sep-05 16:19
lionheart16322-Sep-05 16:19 
Questionhelp in shape extraction from images Pin
bhamaimrith22-Sep-05 16:14
bhamaimrith22-Sep-05 16:14 
Questionhow do I print a string with " " " in it Pin
Spiritofamerica22-Sep-05 14:08
Spiritofamerica22-Sep-05 14:08 
AnswerRe: how do I print a string with " " " in it Pin
Shog922-Sep-05 14:26
sitebuilderShog922-Sep-05 14:26 
Questiontrim? Pin
kerrywes22-Sep-05 12:42
kerrywes22-Sep-05 12:42 
AnswerRe: trim? Pin
Chris Losinger22-Sep-05 13:39
professionalChris Losinger22-Sep-05 13:39 

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.