I got it working and yes I am wearing my dunce hat while I am typing this.
The problem was, as you suggested not assigning memory. I used cout statements to see the memory of my pointer declaration and confused this with assignment.
I also brought in the function. Without further ado, my code(pointers only, no references)
Code:
#include <iostream>
#include <string>
using namespace std;
void firstAndLast(string* firstname, string* lastname);
int main()
{
string first;
string last;
string* p_first = &first;
string* p_last = &last;
for (int i = 0; i < 3; i++)
{
firstAndLast(p_first, p_last);
cout << "first name is: " << *p_first << '\n';
cout << "last name is: " << *p_last << '\n';
}
}
void firstAndLast(string* firstname, string* lastname)
{
cout << "Enter your first name: ";
cin >> *firstname;
cout << "Enter your last name: ";
cin >> *lastname;
}