Ravinder Singh

Male
Friday, February 24, 1984
I am a software engineer by profession and programmer by passion. I love working on software projects which help make a positive impact on the society.

How to use the list container class and its iterator - Standard Template Library C++

Category: Programming Tutorials Date: Friday, July 22, 2016

For the C++ training group, from our classroom discussions on 19th July, 2016

This is the code for using the list container class and its iterator given to you by the Standard Template Library in C++

int main()
{
    list<int> myList;
    myList.push_back(1);
    myList.push_back(2);
    myList.push_back(3);
    myList.push_back(4);

    list<int>::iterator listIterator;

    for(listIterator=myList.begin(); listIterator != myList.end(); listIterator++)
    {
        cout << *listIterator << "\n";
    }


    return 0;
}



Rate this article and help us improve

Please Login to rate
Overall ratings: 2 | Rating: 2.5 out of 5
Previous Article Next Article

Quick Links

E-Magazines

@

Total Followers
Study Group Created
Study Group Joined
Following Teacher
Following Organization
Blog Articles Added
Questions Asked
Questions Answered
Jobs Posted
Total Members in Group
Questions asked by members
Tasks added in this Group

Please wait..

Ok

Login to Open ESchool OR Create your account    Login   SignUp