Relative Content

Tag Archive for c++pointersvectorc++17

Does `std::cout << &i <<` print address of `i` or address of each element in num?

#include <iostream> #include <vector> int main () { std::vector<int>num{1,2,3}; for (const int &i:num) { std::cout<<i<<“n”; std::cout<<&i<<“n”; } } i’m start learning pointer and vector but these topics got me confused sometimes. c++ pointers vector c++17 New contributor user25173387 is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check […]