cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
How to re-assign a vector with some cons
How to re-assign a vector with some constants ?
May 23, 2012 at 3:16pm UTC
lalebarde
(114)
Hi all,
I have a vector declared somewhere :
vector<
int
> v(2);
I want to change its values.
v = {4, 5};
does not work, nor
v = vector<
int
>({4, 5});
Is there a direct mean to do it overelse than
v[0] = 4; v[1] = 5;
?
Last edited on
May 23, 2012 at 3:16pm UTC
Topic archived. No new replies allowed.