I am trying to access t1.name and t2.name that stored in the link_list, and I don't what to do at the for loop. Could someone please help me out? Thank you in advance.
Code:struct T {std::string name; double unit;}; list<T> link_list; T t1, t2; t1.name = "t1name"; t2.name = "t2name"; link_list.push_back(t1); link_list.push_back(t2); list<T>::iterator iter; for(iter=link_list.begin(); iter != end() ; ++iter) { cout << iter->??? }