For the STL data structure, list, does the index begin at 0 or 1? The online material regarding this is confusing..
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It doesnt have an index. It is implemented as doubly linked list. Only arrays have index. If you need index use vector or deque. they lack direct access to the elements by their position as there is no random access iterator for list.
Read this for more information on lists.