#include #include #include /* lill-me's test-vektor program. Designed and Code by lill-me */ using namespace std; struct house{ int antal; // Hur många som bor där vector namn; // Namnen }; int main(int argc, char *argv[]) { house howmany; cout << "How many people should live in the house: "; cin >> howmany.antal; system("clear"); for(int i=0; i <= howmany.antal; i++) { string temp; cout << "Enter the names of the persons in the house: "; getline(cin,temp); howmany.namn.push_back(temp); // Sparar personerna i vectors "names" } cout << "The names on the persons that live in the house are the following:\n"; for(vector::iterator i = howmany.namn.begin(); i !=howmany.namn.end(); i++) { cout << "" << *i <<"\n"; // Ska uppenbarligen lista ut sakerna i min vector } system("PAUSE"); return EXIT_SUCCESS; }