need some help with this c++ code

Discussion in 'OT Technology' started by hazo, Jan 28, 2006.

  1. hazo

    hazo 矢田亜希子 OT Supporter

    Joined:
    Aug 12, 2004
    Messages:
    253
    Likes Received:
    0
    Location:
    Orange County, CA
    Code:
    #include <iostream>
    using namespace std;
    
    int main()
    {
        
        string groomlastname;
        cout << "Groom's name (last, first): ";
        getline(cin, groomlastname, ',');
        
        int groomlength = groomlastname.length();
        
        string bridelastname, bridefirstname;
        cout << "Bride's name (last, first): ";
        getline(cin, bridelastname, ',');getline(cin, bridefirstname);
        
        int bridelength = bridefirstname.length();
        
        
        cout << "Length of Groom's LAST name: " << groomlength << "\n";
        cout << "Length of Brides's FIRST name: " << bridelength << "\n";
        
        return 0;
    }
    
    im trying to get the lastname of the groom and the firstname of the bride so i can combine them, however i can't seem to get the firstname of the bride correctly any help is appreciated
     

Share This Page