I want to calculate the maximun number that 4 byte integer can hold. However it doesn't seem o work(Gives me '0'). What am I dong wrong?
Code:
#include <stdio.h>
int main()
{
int count, max_size, total;
max_size = 4 * 8; /* Calculate how many bits 4 bytes have */
total = 1;
count = 1;
printf("%i \n", total);
while(count <= max_size)
{
total *= 2;
++count;
}
printf("%i \n", total);
return 0;
}