While using cin.ignore() in c++, it takes an argument of number of characters to consume until the delimiter occurs.
Most often I have observed the following to be used cin.ignore(numeric_limits<streamsize>::max(), '\n');
I was curious to know the value of numeric_limtis<streamsize>::max() so I just outputted its value and it came to be a humongous value of 9223372036854775807 .
If it represents the number of characters, then it can be considered in bytes and if that's true, isn't this a very large value exceeding my HDD space.
Can someone please tell me what it actually is and why such a large value ?
2^63 - 1, which is the maximal value of a signed 64bit integer.streamsizeis just a typedef. Afaik also with containers you would run into problems before you pushnumeric_limits<size_t>::max()elements. I think those are just telling you what the types can support, while you seem to care about what your physical hardware can support