Mail Archives: djgpp/1999/01/14/16:16:32
> could someone please explain to me how size_t works please?
size_t is a variable whose range of values covers all possible sizes
of other variables. Example:
size_t a;
char b[100];
a = sizeof(b); /* a is now 100 */
printf("a = %d\n", a); /* prints "a = 100" */
> ie. when you decalre a variable to be of type int at compile time it sets
> aside 2 bytes for the integer to be stored.
4 bytes.
> What happens when you declare a variable or function to be of type
> size_t ??
You get a variable that can hold the value of the size of any object.
- Raw text -