What are limitations on size of char, are there any differences in c89 and c99 on size of char
What are limitations on size of char, are there any differences in c89 and c99 on size of char
It's always 1.
Quzah.
Hope is the first step on the road to disappointment.
but can be larger than 8 bits(in both c89 and c99), right ?
It could be, but sizeof will always give you 1. You are interested in CHAR_BIT.
Quzah.
Hope is the first step on the road to disappointment.
If you make an array of them, yeah. Try compiling and running this program.
That should explain it best. The sizeof() operator returns the size of a variable or variable type in size_t. Take a look at these articles, if you're confused:Code:#include <stdio.h> int main(void) { int x; printf("Size of char: %d\n", sizeof(char)); for (x = 2; x < 10; x++) printf("Size of %d chars: %d\n", x, (sizeof(char) * x)); return 0; }
sizeof - Wikipedia, the free encyclopedia
For, While and Do While Loops in C - Cprogramming.com
Cprogramming.com FAQ > Format output using printf() (C)
Originally Posted by The Jargon File
Hope is the first step on the road to disappointment.