How to define vector in prdefine?

i mean as vector v={1,2,3,4,5}; i am getting error?

Hey Kailash,
You need to define the size and datatype of the vector first.

or if you’re trying to do it other way around.
Try something like
vector v{1,2,3,4,5};
Hope this helps. :slight_smile:

@kailash_01 Please let me know if you’ve any further doubts in defining a vector,
If not you may mark the doubt as resolved and if it helped you can mark the rating accordingly. :smiley:

vector v;
v.reserve(5);
vector v{1,2,3,4}; IT IS SHOWING ERROR???