Strlen not working

There is an error, that is showing on my local machine :

[Error] cannot convert ‘std::string {aka std::basic_string}’ to ‘const char*’ for argument ‘1’ to ‘size_t strlen(const char*)’

I’m using Dev-C++ ide.

I just replaced stren(str) with str.size() and it is working perfectly fine.

But, I want to know what was the problem and why it happened?

hello @siddharth_1_3277
stlen function works only on c style strings.

c++ string dont support strlen.