can math operations be performed on a void


Can math operations be performed on a void pointer?

No. Pointer addition and subtraction are based on advancing the pointer by a number of elements. By explanation, if you have a void pointer, you don't know what it's pointing to, so you don't know the size of what it's pointing to.

If you require pointer arithmetic to work on raw addresses, use character pointers

 

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: can math operations be performed on a void
Reference No:- TGS0313295

Expected delivery within 24 Hours