What is the sscanf placeholder for uint8_t types?
What is the sscanf placeholder for uint8_t types? I tried %u, but gcc under OS X doesn't lik开发者_如何转开发e it.
The SCNu8
macro from inttypes.h
provides it.
Also note that C has string literal concatenation, i.e. this works:
scanf("%d %" SCNu8 " %d", &int_a, &uint8_t_b, &int_c);
精彩评论