C Programming - Sign Of An Integer

using Bitwise operators only....

int num;
num >> (sizeof(int) * 8 - 1) /* -1 means negative */

Labels:


About this entry