Q:
Would the following program compile?
main()
{
int a = 10, *j;
void *k;
J = k = &a;
J++;
k++;
printf ("\n%u %u", j, k);
}
Answer
An error would be reported in the statement k++ since arithmetic on void pointers is not permitted unless the void pointer is appropriately typecasted.
View answer
Workspace
Report Error
Discuss