code_fille's blog

By code_fille, 11 years ago, In English
int main() 
{
	//Beauty is in relaxed hard work.
	//SSGCA :)
	//Keep doing your thing, complexity would turn into simplicity! :)
    unsigned short int a=0xffff; 
    ~a;
    printf("%x",a);
	return 0;
}

Why does this program output 'ffff' and not 0000?

  • Vote: I like it
  • -11
  • Vote: I do not like it

»
11 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it
a = ~a;