Kamikaze_Badger Posted July 16, 2005 Posted July 16, 2005 Is there any easy way to grasp the concept and usage of polymorphism? I understand that it's uber powerful and all (and uber evil), but there are very few guides on it, and the ones that are there tend to be confusing. So, does anyone know any tutorials or anything that introduce polymorphism and actually explain it and all? Or, can someone describe it in a nutshell? This stuff is more evil than WinSocks... EDIT: So, no-one wants to help? Oh markie, where art thou? Share this post Link to post Share on other sites More sharing options...
markiemrboo Posted July 16, 2005 Posted July 16, 2005 Is there any easy way to grasp the concept and usage of polymorphism? I understand that it's uber powerful and all (and uber evil), but there are very few guides on it, and the ones that are there tend to be confusing.So, does anyone know any tutorials or anything that introduce polymorphism and actually explain it and all? Or, can someone describe it in a nutshell? This stuff is more evil than WinSocks... EDIT: So, no-one wants to help? Oh markie, where art thou? 510193[/snapback] Sleeping 'twas a great sleep too. Actually managed to fall asleep before 1AM I think! I expect you're wanting polymorphism in C++? I learnt about it in......... Java It is a difficult thing to explain... I'll uhm... work up some code(?), find tutorials and stuff for you later on. In the mean time you could practice pointers, because you'll be needing them Maybe play with structures too? Share this post Link to post Share on other sites More sharing options...
Kamikaze_Badger Posted July 16, 2005 Posted July 16, 2005 So knowing how to use a pointer to point to data within a structure element isn't enough? Share this post Link to post Share on other sites More sharing options...
markiemrboo Posted July 16, 2005 Posted July 16, 2005 Possibly Pointers to structures if you dont know about those... and perhaps try pointers to pointers to see if you properly understand pointers yet Share this post Link to post Share on other sites More sharing options...
Silverfox Posted July 16, 2005 Posted July 16, 2005 aww man....polymorphism.....i remember learning that.....and promptly forgetting about it. if i can find my old computing book, i'll reply with an explanation man...you do pick 'em KB.... Share this post Link to post Share on other sites More sharing options...
Kamikaze_Badger Posted July 16, 2005 Posted July 16, 2005 You mean a simple int* pPointerToPointer = &pOtherPointer won't work? Share this post Link to post Share on other sites More sharing options...
markiemrboo Posted July 16, 2005 Posted July 16, 2005 You mean a simple int* pPointerToPointer = &pOtherPointer won't work? 510533[/snapback] close.. int i = 123; int *p = &i; int **pp = &p; printf("pp at memory address %x\n", &pp); printf("pp points to %x\n", pp); printf("pp pointer points to %x\n", *pp); printf("pp value %d\n", *(*pp)); printf("\n"); printf("p at memory address %x\n", &p); printf("p points to %x\n", p); printf("p value %d\n", *p); pp at memory address 22ff34pp points to 22ff38 pp pointer points to 22ff44 pp value 123 p at memory address 22ff38 p points to 22ff44 p value 123 Press any key to continue . . . Share this post Link to post Share on other sites More sharing options...
Kamikaze_Badger Posted July 16, 2005 Posted July 16, 2005 Ahhh... so I needed that extra *... Yes, I'm tired. danged Harry Potter book release... Share this post Link to post Share on other sites More sharing options...
Archerzz Posted July 19, 2005 Posted July 19, 2005 is the book any good? Share this post Link to post Share on other sites More sharing options...
Kamikaze_Badger Posted July 19, 2005 Posted July 19, 2005 I don't know, havn't read it yet. D@MNED SIBLINGS! Share this post Link to post Share on other sites More sharing options...
Archerzz Posted July 19, 2005 Posted July 19, 2005 lol beat them up Share this post Link to post Share on other sites More sharing options...
Kamikaze_Badger Posted July 19, 2005 Posted July 19, 2005 I would if I weren't madly in love with my new mate . Share this post Link to post Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now