This function call (I fixed the missing ") has two parameters. Neither of them are string objects. The constructor wants string objects, and your compiler appears not to know how to turn these two const char arrays into strings.
@Moshchops That was a typo I made while posting . I am using GNU gcc compiler it's not old I guess.
@ajh32
My intention was to if the price , weight and owner are not provided they are set to some default values why doesn't it work that way ? Any other way to do that ? Also I created a new object something like this . Cat newCat("Garfied","df",23,23.23,"Myself");
By providing values for all the arguments and it works. But shouldn't it work for if I just provided some arguments and rest to the default ?
You set the argument default values in the function prototype declaration, not in the source code. See my comment above for the correct way to do default argument values, i.e. what you intended.
The first version dates from 1987. That's a long time ago. How old is the one you're using?
Edit: Did you change the code in the original post? Please don't, it renders the entire thread nonsensical.
He didn't you just don't understand how c++ works for default arguments. The default argument value MUST be declared in the function prototype i.e. header and NOT NOT in the source. See my code in the comment above.
Likewise. The code I posted compiles and runs fine. The default arguments are not in the prototype.
The default argument value MUST be declared in the function prototype i.e. header and NOT NOT in the source.
That is NOT NOT NOT true. Putting them in the definition and not the declaration is a way to ensure that only those who can see the definition use the defaults. In this case above, the code can see the definition, so it's fine. Perhaps the OP had his code strewn across multiple files.