0
diff between (int *)&a and &a
#include<stdio.h> int main() { int a; int *x; x = (int *) &a; //x=&a; above line and this are functioning same, so whats the difference a = 512; x[0] = 4; x[1] = 2; printf("%d",a); return 0; }
4 Respuestas
+ 1
In C, `(type) expression` converts the expression to the specified type. For example 10 / 3 is 3 and 10 / (float) 3 is 3.333f.
In this example &a is already of type (int *) so there is nothing for the conversion to do.
0
if (char *) &a means integer to character conversion right
0
Integer pointer to character pointer to be precise, but sure.
0
Can you please explain with an example program