Get Started
872

Q: Would the following program compile? main() {     int a = 10, *j;     void *k;     J = k = &a;     J++;     k++;    printf ("\n%u %u", j, k); }

  • Show Answer
  • Workspace

Answer :
Explanation :

An error would be reported in the statement k++ since arithmetic on void pointers is not permitted unless the void pointer is appropriately typecasted.

The Most Comprehensive Exam Preparation Platform

Get the Examsbook Prep App Today