ineedhelpnow
- 649
- 0
i may have asked this before but what is the difference between and at(i)?
ex. courseGrades and courseGrades.at(i)
ex. courseGrades and courseGrades.at(i)
ineedhelpnow said:i may have asked this before but what is the difference between and at(i)?
ex. courseGrades and courseGrades.at(i)
ineedhelpnow said:so you can't call a function using courseGrades?
ineedhelpnow said:im confused. do you use to check through all the items in the list??
ineedhelpnow said:im confused. do you use to check through all the items in the list??
ineedhelpnow said:can someone please show me an example of that when to use and when to use at(i)?like a single line of code or something. it would make it a lot more clear...
#include <vector>
std::vector<int> v;
for (int i = 0; i < v.size(); ++i) {
cout << v[i] << ", ";
}
for (int i = 0; i < v.size(); ++i) {
cout << v.at(i) << ", ";
}