+ 2
What is auto keyword in C++?
What is its functionality?
2 Respostas
+ 6
https://en.cppreference.com/w/cpp/language/auto
Type deduction during initialization. The 'auto' keyword tells the compiler to deduce the type of a variable from its initialization expression.
How is it useful?
Instead of doing
std::vector<std::vector<std::string>> obj = new std::vector<std::vector<std::string>>;
you can now do
auto obj = new std::vector<std::vector<std::string>>();
+ 3
Thanks for helping