471,066 Members | 1,898 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,066 software developers and data experts.

Error C2660 Function does not take 1 argument

1
This seems like a cool site, I wish I could have found this sooner.

Can someone pls help me with this line of code? I get an error C2660 telling me the function does not take an argument ( The portion in Bold face is the line I get the error in).
Thnxs


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;
}
Apr 2 '07 #1
1 10341
nmadct
83 Expert
This seems like a cool site, I wish I could have found this sooner.

Can someone pls help me with this line of code? I get an error C2660 telling me the function does not take an argument
It's just as the error says. The size() function doesn't take an argument. I've highlighted the argument that's causing the problem:

str1.size() >= str1.size(15)

I'm not sure what you were trying to do by using the 15 as an argument to size(), but what you want is probably this:

str1.size() >= 15
Apr 2 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Andreas Poller | last post: by
3 posts views Thread by raveneros | last post: by
1 post views Thread by unknownbomb | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.