|
-
July 19th, 2005, 11:01 AM
#12
Re: Some Questions
 Originally Posted by NMTop40
pointers to functions don't have to be the same size as pointers to data. That is why it is undefined behaviour to cast a pointer to a function to void* and vice-versa.
Note therefore that you should not use dlsym() to get a pointer to a function, but instead get your shared-object libraries to always return pointers to objects if you want to be safe (and use them for dynamic loading).
GetProcAddress() is slightly safer in that it returns a more abstract FARPROC handle, which suggests a pointer to a function.
Yes, I did come to know about this in the above mentioned thread. And I posted my latest doubt on that thread only. NMTop40, thanks anyways. You are always informative .
Can you help me with my homework assignment?, Before you post!, Use code tags, How to post!, Codeguru technical FAQs, C++ FAQ Lite, Stroustrup: C++ Style and Technique FAQ, Guru of the Week, Comeau C and C++ FAQs, Comeau C++ Templates FAQs, CUJ @ DDJ, Spam threshold
My Blogs : Learning C++ is fun | Abnegator's reflections
Open Threads : C++ Aha! Moments | Nature of work in C++?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|