Do not use an unsigned type to represent a quantity just because it will be never negative (e.g. age or national_debt).
#include<stdio.h> main() { int negative = -1; unsigned positive = 1; if(negative < positive) printf("This is what we want.\n"); if(negative > positive) printf("It's just the semantics.\n"); }
No comments:
Post a Comment