Can you explain (from scratch,in plain English) the conversion of the negative integer -1234
to int16_t
type?
I have gone through many materials in the internet and got confused.
What would be the binary representation of -1234
in int16_t
type?
The code I have tried was:
<code>#include <stdio.h>
#include <stdint.h>
int main(void) {
int16_t a = -1234;
printf("%x",a);
return 0;
}
</code>
<code>#include <stdio.h>
#include <stdint.h>
int main(void) {
int16_t a = -1234;
printf("%x",a);
return 0;
}
</code>
#include <stdio.h>
#include <stdint.h>
int main(void) {
int16_t a = -1234;
printf("%x",a);
return 0;
}
out : fffffb2e
1