does push_back only take string-dataype arguments ?
Doubt on push_back
hello @prerak_semwal
no it depends on datatype of container.
for example->
a) vector v;
here datatype is string so we can push string. if it is of some other type then u can push data of that datatype.
…
push back is memory function of string , vector ,deque class etc
its not in iostream
u have defined char array , it does not have push_back function.
use c++ string, if u want to use push_back
1 Like
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.