we know "size_t" as an unsigned integer but i can give negative value to a variable and print it ? so what would i use this size_t for a reason ?
we know "size_t" as an unsigned integer but i can give negative value to a variable and print it ? so what would i use this size_t for a reason ?
You can assign a negative integer to size_t, but the value will be positive (wrap around).
Post sample code of your problem if you need further clarification.
Actually all we "know" is that size_t is an implementation defined unsigned type, it not necessarily an unsigned int. It could be any unsigned type such as an unsigned long, unsigned long long, unsigned int, or even an unsigned short.we know "size_t" as an unsigned integer