I'm having some issues with this homework question, is the output a constant string of 0's?
#include <stdio.h>
int main()
{
unsigned char x;
for (x = 0; x <= 0xFF; x++) {
printf("0");
}
printf("1\n");
}
I'm having some issues with this homework question, is the output a constant string of 0's?
#include <stdio.h>
int main()
{
unsigned char x;
for (x = 0; x <= 0xFF; x++) {
printf("0");
}
printf("1\n");
}
You can check what will happen by checking the size of the character in bits:
int main(void)
{
unsigned char x;
#if CHAR_BIT > 8
for (x = 0; x <= 0xFF; x++) {
printf("0");
}
printf("1\n");
#else
printf("This loop will never end\n");
#endif
}