Initialize A Vector With User Input | C++ Example

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

I like to learn about STL libraries. Your video helps me a lot.

MohitRaj-
Автор

Hello, very nice tutorial. Couple of questions if you can answer please:
@2:11 (auto elem : data); you have not defined elem previously. I have tried the program with "auto and int" and "x and elem". It works the same. So "elem" is just a variable which C++ recoignizes itself how to use without nitial declarationor initialization @4:45. Am I correct?
Also, what is the difference between auto and int if both perform similarly?
Third, you advised that vactor size grow dynamically, can you please elaborate the dynamic increase.
Thanks and Best Regards

syedimadhaqqi
Автор

error: no match for 'operator>>' (operand types are 'std::istream {aka
std::basic_istream<char>}' and 'std::vector<double>')
am getting this error when i use cin << data[i];

sumab