Square.cpp:30:8: error: prototype for ‘std::string Square::int2string(int*)’ does not match any in class ‘Square’
Square.h:21:10: error: candidate is: std::string Square::int2string()
I declared the following in header file.
string int2string();
The error is due to variable type does not match. Is there a better way to convert int array to string, please?
What I'm trying to achieve is a string printed in the following manner:
But the source for your class does not match this declaration, i.e. in your source you have an int in the argument list whereas you don't have any arguments in the function proto-type declared in the header.
also fix the logic of your function - seems like you should place the return statement outside of the for loop - having it inside will cause you for loop to only execute once and not four times.
you may also want to separate the integers added into [returnstring] with a comma so as to still preserve the original ints added.