error: incompatible types in assignment of 'std::__cxx11::string' {aka'std::__cxx11::basic_string<char>'} to 'char [100]'
error: cannot convert 'std::__cxx11::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
and I got the above two errors for these lines of codes
string s1=asctime(localtime(&timetoday));;
string r=s1.substr(4,6);
ch=r; //char ch[100];(defined aleady)
//1st error was in line just above this comment
if(strcmp(r,"Dec 20")==0)
//2nd error was in line just above this comment
{
cout<<"made my first try for creating this program";
}
else if(strcmp(r,"Dec 21")==0)
{
cout<<"Shortest day of the year";
}
I'm trying to create a simple remainder program in C++ using code blocks.