What is c_str and data functions in strings? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What is c_str and data functions in strings?

How it works and why it's used and how ?

8th Mar 2022, 12:38 AM
Melissa Akli
Melissa Akli - avatar
1 Answer
+ 3
c_str () simply returns C-style string ( char array terminated with '\0' ) from a C++ string ( std::string class ) Here is an example discussed where it might be useful 👇 https://www.sololearn.com/Discuss/2977617/?ref=app
8th Mar 2022, 12:57 AM
Arsenic
Arsenic - avatar