O
onkar
#include<stdio.h>
int main(void){
unsigned int m=0xfdff;
~m;
printf("%x\n",m);
return 0;
}
gives me :
$ gcc -Wall -g -o test test.c
test.c: In function `main':
test.c:4: warning: statement with no effect
$ ./test
fdff
whereas this works out properly :
#include<stdio.h>
int main(void){
unsigned int m=0xfdff;
printf("%x\n",~m);
return 0;
}
$gcc -Wall -g -o test test.c
$ ./test
ffff0200
Why ???
int main(void){
unsigned int m=0xfdff;
~m;
printf("%x\n",m);
return 0;
}
gives me :
$ gcc -Wall -g -o test test.c
test.c: In function `main':
test.c:4: warning: statement with no effect
$ ./test
fdff
whereas this works out properly :
#include<stdio.h>
int main(void){
unsigned int m=0xfdff;
printf("%x\n",~m);
return 0;
}
$gcc -Wall -g -o test test.c
$ ./test
ffff0200
Why ???