Suppose you want to run code that involves the loop
//Assume vector v and iterator p has been defined and
//given appropriate values
for p = v.begin); p != v.end); p++)
cout << *p << " ";
Which of the following could you use to declare the iterator p? Why?
std::vector<int>::iterator p;
std::vector<int>::const_iterator p;
Correct Answer:
Verified
View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Q38: Which of the following operations do forward
Q39: Suppose we have the following definition:
Vector<int> vec;
//
Q40: Suppose we have the following definition:
Vector<int> vec,
Q41: Define an iterator into a list of
Q42: Assume proper includes have been executed, but
Q44: Assume proper includes have been executed, but
Q45: What is the difference between the iterators
Q46: What is a generic algorithm?
Q47: What kind of iterators does the stack
Q48: Can you use the random_shuffle generic algorithm
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents