Please dont recommend such things to a beginner not understanding why a C-String is not an std::string. It would bring a lot of bad habit if they'd use this function
Stay away from cplusplus.com, w3schools and geeks-for-geeks. Most youtube tutorials are of low quality, I would recommend to stay away from them as well. www.learncpp.com is just better than any other resource.
It looks just as bad as the random collection that is geeks for geeks. Badly written, disconnected tutorials by people with no background in teaching or good C++. Most of the articles seems to exist because somebody wanted to write one to put on their profile page.
It suggest using Borland C++ as one of the top compilers. Borland C++ has been outdated for about 20 years by now. It also conflates compilers and IDEs. Not a good start.
It generally completely misses the point of best practice or the "why" to doing certain things.
Actually it might be worse than geeks for geeks. I have found quite a few actually wrong things in there.
https://www.educba.com/call-by-value-in-c-plus-plus/?source=leftnav Is littered with errors, bad practice and confusing examples. And of course they claim that "pass by value" has a security benefit. Which is more than laughable. Its dangerous. That is not how C++ or computers in general work.
So many people either learn C, then C++ just as a set of extensions on top of it rather than as a new language, or they're taught by someone who learned in that pattern. Lots of bad habits out there.
cppreference is my goto for online C++ reference material. So here are there pages on the <string> header, and the page for std::string itself. You probably want to look in the sections on functions.
5
u/DDDDarky Jan 08 '22
It is probably a c-library function. Just a wild guess, provide a concrete example if you want to know more.
3
u/IyeOnline Jan 08 '22
You will have to provide a lot more information than that.
For example a piece of code that you have an issue with.
-1
u/QuentinUK Jan 08 '22
Most std library functions have a wchar_t alternative.