I am working on an assignment that will return the string length in the number of characters. Here is what I've done so far, but I have no clue how to use the string() function. Any help would be appreciated.
Code:
#include <iostream>
#include <string>
using namespace std;
int main()
{
cout << "Groom's Name (last,first): ";
string groomfirst;
string groomlast;
cin >> groomlast >> groomfirst;
cout << "Bride's Name (last, first): ";
string bridefirst;
string bridelast;
cin >> bridelast >> bridefirst;
size_t groom;
groom = groomlast.length();
size_t bride;
bride = bridelast.length();
cout << "Length of Groom's LAST name: " << groom << endl;
cout << "Length of Bride's LAST name: " << bride << endl;
return 0;
}