Hi folks,
I get this error message on this line when I try to count the amount of characters in a string. I wanted to count the characters so I can manipulate how the output is shown. It tells me no argument is made whereas I feel that the particular line (In Bold) where the error occurs is precisely the argument I might need to count it. What is wrong with this if statement: Pls Help!
Thanks
class Party
{
private:
string str1;
string str2;
public:
Party(string n = "Bruce Willis", string a = "The BamBoo Cult")
{
str1 = n;
str2 = a;
}
void GetInfo();
void DisplayInfo();
};
void Party::GetInfo()
{
cout <<"Enter student name\n";
cin >> str1;
cout <<"\n\nPlease enter students fraternity or cult\n\n";
cin >> str2;
}
void Party:DisplayInfo()
{
if (str1.size() >= str1.size(15))
{
cout << "\n****************************************\n";
cout <<"\n " << str2 <<" \n";
cout <<" "<< str1 <<" \n";
cout <<"\n******************************************\n";
}
else
{
cout << "\n "<< str2 <<": " << str1;
}
}
int main()
{
Party PartyDay;
PartyDay.GetInfo();
PartyDay.DisplayInfo();
return 0;
}