Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

how to set a stack using linked list in c++

+4 votes
asked Aug 19, 2019 by Divyansh Sen (160 points)

1 Answer

+1 vote
answered Jun 3, 2025 by Jerry Jeremiah (2,040 points)
I am not sure I understand your question.  Why can't you just do this:

    std::list<std::string> list{"a","b","c");
    std::stack<std::string> stack(list.begin(), list.end()};

What is your actual question?
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and receive answers from other members of the community.
...