I written a method whatTime() as shown below
Code:
class Time {
public:
string whatTime(int);
};
string Time::whatTime(int seconds) {
string result = "";
int hours,minutes,secs;
hours = seconds /3600;
minutes = (seconds % 3600) / 60;
secs = seconds % 60;
result = hours + ":" + minutes + ":" + secs;
return result;
}
When i compile the code, getting error
test.cpp:33:34: error: invalid operands of types ‘const char*’ and ‘const char [2]’ to binary ‘operator+’
I am new to C++ programming.