I though that we can use “auto” everywhere instead of typing datatype.
But it seems we can’t !
Could you please explain where we can ?
I though that we can use “auto” everywhere instead of typing datatype.
But it seems we can’t !
Could you please explain where we can ?
auto will not work in this case
you can use vectors for that
auto v1= vector {1,2,3,4};
c++ is not loosely typed language like python or javascript
we have to give the type once to tell the compiler that this is a vector of int or array of int
after that we can use auto