cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Lounge
How do I post a question
How do I post a question
Jul 30, 2009 at 2:52pm UTC
faiak994
(2)
I am having problem in swapping the contents of vector(making current element as the first one).
where and how can I post this question.
Thanks
Jul 30, 2009 at 3:04pm UTC
Bazzy
(6281)
In
General
or
Beginners
section.
BTW, STL gives you the right function:
http://www.cplusplus.com/reference/algorithm/swap/
Jul 30, 2009 at 4:07pm UTC
faiak994
(2)
Thank you Bazzy!
Actually I had to insert an element at the end of vector. Then I had to make it the first element and move all elements one by one (making first one the second , second as third and so on).
Last edited on
Jul 30, 2009 at 4:18pm UTC
Jul 31, 2009 at 8:42pm UTC
Bazzy
(6281)
If you use a deque instead of a vector, you can insert elements at the beginning of it:
http://www.cplusplus.com/reference/stl/deque/push_front/
Topic archived. No new replies allowed.