c - Void pointer type conversion -


i want print addresses of void pointer

u32 j; (j = 0; j < sizeof(struct queue_header); j += 4)  {     printf("0x%x ",(u32 *)((u32 *)q->q_hdr + j)); //q_hdr  void pointer         } 

but type conversion giving error:

warning: cast pointer integer of different size [-wpointer-to-int-cast]

can please tell me how can print address.

that's %p for: printing pointers.

printf("%p ", (void *)((u32 *)q->q_hdr + j)); 

should want.


Comments

Popular posts from this blog

javascript - IndexedDB error: Uncaught DataCloneError: Failed to execute 'put' on 'IDBObjectStore': An object could not be cloned -

amazon web services - When using Cognito credentials with AWS in a browser (javascript), keep getting "missing credentials" error -

c# - How to set the datatextfield value instead of the value on a drop down list? -