#include <iostream>
#include <vector>
#include <string>
usingnamespace std;
//This will build a vector with student lastname, firstname and ID
string buildStudent()
{
std::vector<string> rawCollStudents;
string first = "John";
string last = "Smith";
string ID = "111";
string my_student = first + last + ID;
//Now I have vector with string content in it
rawCollStudents.push_back(my_student);
return my_student;
}
//Now that I built vector, retrieve content from vector and print it
void retrieveStudent(vector<string> student) //<=== Goal is to pass content of vector rawCollStudents as argument here. It gives me an error
{
for (string elem : student)
{
cout << elem;
}
}
int main()
{
string get_student;
get_student = buildStudent();
retrieveStudent(get_student);
return 0;
}