Home > Back-end >  Strlen type problem
Strlen type problem

Time:10-01

Error C2664: 'strlen: always convert parameter 1 from' class STD: : basic_string & lt; Char, struct STD: : char_traits & lt; Char> Class, STD: : allocator 'to' const char * '
No user - defined - conversion operator available that can perform this conversion, or the operator always be called


Strlen parameters has been read from the file save but into a string array with strlen function wrong too Shinto faith I...

CodePudding user response:

Specific code is how to write

CodePudding user response:

Since you use the string, that is directly with the length of the string () method returns the length of the string, use strlen, if anything, can be like this:
String STR.
Size_t len=strlen (STR) c_str ());
  • Related