0
Advantage of using At function in c++
What is the difference in accessing a character from string normally and by at function?
1 Resposta
+ 2
The at function does out-of-bounds checking, it throws an std::out_of_range exception if you try to access out-of-bounds whereas the subscript operator does not perform any checks.
Because of the check the at function is slower than the subscript operator but if you know what you're doing you usually don't need the at function anyway.