Meaning of

P

parag_paul

Can some body tell me what is the meaning of the following?
vector<int> v(5,6);


Since I have seen vector<int> to be declared always as,
vector<int> v(100);
or something like that> What could two be used for;
 
I

Ian Collins

Can some body tell me what is the meaning of the following?
vector<int> v(5,6);


Since I have seen vector<int> to be declared always as,
vector<int> v(100);
or something like that> What could two be used for;
Maybe you should get a copy of the standard or a good book?

vector<int> v(5,6) is a vector constructed with 5 copies of the int value 6.
 
P

parag_paul

Maybe you should get a copy of the standard or a good book?

vector<int> v(5,6) is a vector constructed with 5 copies of the int value 6.

Thanks
I got that, a bit later, Since the web page I was reading did not
provide me with much.

Thanks Ian,
I apologize
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top