study of pointers - 4.

#include <stdio.h>

int main(void)
{
float f;
char ch;
int i;
void *p;

f = 123.456;
ch = 'V';
i = 11;

printf("\nOriginal values : %f %c %d", f, ch, i);

p = &f;
*((float *)p) = 6654.321;

p = &ch;
*((char *)p) = 'L';

p = &i;
*((int *)p) = 55;

printf("\nNew values : %f %c %d", f, ch, i);


return 0;
}

No comments:

Post a Comment

kiss on google ads if you are anonymous because your ip is trackable.thank you.

......from.admin