I am new to C programming i am learning pointers so i wrote this, i expected the value of c to be 25.345 but it is showing some other big number pls explain...
1 2 3 4 5 6 7 8 9 10 11
#include <stdio.h>
main( )
{
float a = 25.345, c ;
longunsigned *b ;
b = &a ;
c = *b;
printf ("%f %lu %f", a, b, c);
}
Using %d for pointers is incorrect. You got lucky and your program was compiled in 32bit mode. Next time you might be not so lucky. use %p format specifiers for pointers.
//Remember, parentheses around each argument
//and parentheses around whole expression.
#define PRODUCT(x) ( (x) * (x) )
//Remember to never use that macro with operations with side effects, like i++