0
What is the meaning of line:aa=(char*)a; and bb=(char*)b;......its a c language program
#include<stdio.h> int main() { int a=54; float b=3.121; char *aa,*bb; aa=(char*)a; bb=(char*)b; printf("%d",aa); printf("%u",bb); return 0; }
8 Réponses
0
Its like converting floats and integers to char
0
You need to add this conversion if you want to assign an integers address to a char pointer otherwise you will get compiler error
0
when you print aa it will give you same data
0
is it like type casting a pointer??
0
what does it basically do to our char pointer??
0
a variable is an integer aa pointers type is char that line converts a to char if you print aa pointer in %c it will show you a character from the ASCII code which is equal to a's value
0
you cant assign a char pointer to int variable so that line basically converted a to char and printed a's value as decimal as you see in printf %d
0
it is same with defining an integer type aa pointer and assigning it with integer a