Search code examples
cturbo-c

Will this program compile in Turbo C?


I want to know because I am currently learning C.

#include<studio.h>

int main()
{
  into a=10, *j;
  void *k;
  j=k=&a;
  j++;
  k++;
  printf("%u %u\n, j, k");
  return 0;
}

Solution

  • No. There is an error in statement k++. We cannot perform arithmetic on void pointers.

    The following error will be displayed while compiling above program in TurboC.

    >     Compiling PROGRAM.C:
    >     Error PROGRAM.C 8: Size of the type is unknown or zero.