>You should perhaps try this:
>void* ptr=but_ptr+20;//this is good
Perhaps you should try it first. You have no excuse for giving an answer that will never compile on a conforming C compiler.
ArkM gave the correct answer (and corrected tux's misconception about casting malloc). Alternatively, you can cast the pointer to void to a pointer to an appropriate type, but regardless of how you do it, void* has to be converted to T* to do anything meaningful with it, where T is a non-void type.
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Offline 11,807 posts
since Sep 2004