Quantcast
Channel: When should I use typedef in C++? - Stack Overflow
Viewing all articles
Browse latest Browse all 14

Answer by Rana Vivek for When should I use typedef in C++?

$
0
0

1 practical example of typedef is size_t. It is guaranteed to be big enough to contain the size of the biggest object the host system can handle. The maximum permissible size is dependent on the compiler; if the compiler is 32 bits then it is simply a typedef for unsigned int but if the compiler is 64 bits then it would be a typedef for unsigned long long. The size_t data type is never negative.


Viewing all articles
Browse latest Browse all 14

Trending Articles