If I want to get to a value in vector I can use two options : use the [] operator. Or I might use the function .at example for using :
vector ive
The other answers are entirely correct, but may give the impression that it is a good idea to use at() when writing code that you'll still be debugging, as that will cause an error to be signalled. This is the case in general, but doesn't apply for most widespread compilers -- gcc can be set to perform (fatal) range checks by putting it in debug mode and something similar can probably be done in Visual Studio.