DragonFly BSD
DragonFly users List (threaded) for 2005-04
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Help with size_t


From: walt <wa1ter@xxxxxxxxxxxxx>
Date: Wed, 6 Apr 2005 08:20:00 -0700

To pick a random instance, in libkinfo:
size_t len = sizeof(*cputime);

By wandering through /usr/include I can find that size_t works out
to be an 'int', which makes good sense.  The number of bytes in
*cputime is going to be a small integer number, certainly not more
than 128, probably less.

So, my real question is:  why go thru the dance of using 'size_t' when
I know for sure that an 'int' is going to work perfectly?  What is the
motivation for this confusing chain of typedefs?

If I just get an example of how using 'int' instead of 'size_t' would
wind up doing the wrong thing, I would have a much better feel for this
confusing topic.

Thanks for any clues.




[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]