int or size_t ?

bearophile bearophileHUGS at lycos.com
Sat May 7 11:34:46 PDT 2011


%u:

> In Patterns of Human Error, the slide 31 point that you should replce int with
> size_t
> why that consider an error ?

If T is a byte and the array size is 5 billion items, on 64 bit systems...? In the little find() function you compare it with the length, that's a size_t. Someone else will give you better answers.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list