I've been searching these forums and Google for good articles on how to use C++ sets and lists but I've only found a lot of stuff talking about their built in functions, not actually using them. Do any of you know of any good tutorials? I started building a test program but I ran into some compiler errors:
Code:#include <set> #include <iostream> #include <list> #include <cstdlib> int main(int argc, char *argv[]) { list<int> intList; // line 8 for(int i = 0; i < 10; i++) { intList.push_front(i + 10); // line 12 } list<int>::iterator theIterator; // line 15 for(theIterator = intList.begin(); theIterator != intList.end(); theIterator++) { cout << *theIterator; } system("Pause"); return 0; }Code:8 setTest.cpp `list' undeclared (first use this function) 8 setTest.cpp expected primary-expression before "int" 8 setTest.cpp expected `;' before "int" 12 setTest.cpp `intList' undeclared (first use this function) 15 setTest.cpp expected primary-expression before "int" 16 setTest.cpp expected `;' before "int" 17 setTest.cpp `theIterator' undeclared (first use this function) 19 setTest.cpp `cout' undeclared (first use this function)



LinkBack URL
About LinkBacks


