class String
{
private:
static const int SZ = 80;
char str[SZ];
public:
String()
{
strcpy_s(str, " ");
}
String(char s[])
{
strcpy_s(str, s);
}
}
This is the constructor i have written, note the second one
and here I am using it:
String s1 = "yes";
String s2 = "no";
String s3;
This is the error message :
Severity Code Description Project File Line Suppression State Error (active) E0415 no suitable constructor exists to convert from "const char [4]" to "String" rishabh c++ projects F:\rishabh c++ projects\rishabh c++ projects\main.cpp 35
const char[4].