#include <stdio.h>int main(){// Variable declarations//signedchar sc =0;unsignedchar uc =0;// Find the max value for a signed char (half of the max of an unsigned char)//
sc =((unsignedchar)(uc-1)/2)+1;fprintf(stdout,"TYPE: unsigned char\n-------------------\n");fprintf(stdout,"\tsize: %hhu bytes\n",sizeof(unsignedchar));fprintf(stdout,"\t low: %hhu\n", uc);fprintf(stdout,"\thigh: %hhu\n",(uc-1));// max of unsigned is 1 less than 0-- roll-overfprintf(stdout,"-------------------\n\n");fprintf(stdout,"TYPE: signed char\n-------------------\n");fprintf(stdout,"\tsize: %hhu bytes\n",sizeof(signedchar));fprintf(stdout,"\t low: %hhd\n",(sc-1));fprintf(stdout,"\thigh: %hhd\n", sc);fprintf(stdout,"-------------------\n\n");return(0);}
haas/fall2023/common/datatyperanges.txt · Last modified: by 127.0.0.1