@Ramesh yes you can assign value at it.But Void pointer can be used to point at any kind of variable but on dereferencing you must cast it. eg : In above case *((int*)vp) = 3 will work.try it..
@priyaranjan u said dat u can assign value at it but again u r saying dat u hav to dereference it. i think its a conflict dude. when u r typecasting something it no longer behaves like a void pointer.
*vp = 3;
ReplyDeletevp is a void pointer. pointing to void. not an integer pointer. so cant assign an integer at the location pointed by void pointer.?
@Ramesh yes you can assign value at it.But Void pointer can be used to point at any kind of variable but on dereferencing you must cast it.
ReplyDeleteeg : In above case *((int*)vp) = 3 will work.try it..
@priyaranjan u said dat u can assign value at it but again u r saying dat u hav to dereference it. i think its a conflict dude. when u r typecasting something it no longer behaves like a void pointer.
ReplyDelete@above please elaborate what you want to say...
ReplyDelete