On compiling I am not able to concatenate the string.I am a little confused as to how do I concatenate.I tried to typecast and then concatenate,but that too throws an error.
#include<iostream>
#include<cstring>
using namespace std;
string whatTime(int n)
{
int h=n/3600;
int m=n/60;
int s=n%60;
string s1=h + ":" + m + ":" + s;
}
int main()
{
string s=whatTime(63);
cout<<s;
return 0;
}
I am getting the error
invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'