What will be the output of the following program?
#include stdio.h 

int main()
{

int iVal;

char cVal;

// void pointer

void* ptr;

iVal = 50;

cVal = 65;


ptr = &iVal;

printf("value =%d, size= %d\n", *(int*)ptr, sizeof(ptr));


ptr = &cVal;

printf("value =%d, size= %d\n", *(char*)ptr, sizeof(ptr));

return 0;
}


Posted on by