+ 6

[SOLVED] can someone explain what ->c.str() means?

https://code.sololearn.com/ceqfSIbquN6x

10th Sep 2018, 5:18 PM
LONGTIE👔
LONGTIE👔 - avatar
5 odpowiedzi
+ 6
c_str() converts 'string' into 'char string'(C string) like in C. In C, there is no data type like string so we use char array to store string. Now let's say you are working on C++, you encounter some C functions which require C string (char array) as a parameter. Then this function comes in handy
10th Sep 2018, 6:10 PM
blACk sh4d0w
blACk sh4d0w - avatar
+ 4
Ok know I understand thanks nAutAxH AhmAd
10th Sep 2018, 6:11 PM
LONGTIE👔
LONGTIE👔 - avatar
+ 3
c_str() converts a "string" into a "char*"
10th Sep 2018, 5:41 PM
hinanawi
hinanawi - avatar
+ 3
just a point to array adress
16th Sep 2018, 1:51 PM
jacycic
jacycic - avatar
+ 1
I need string in " "
12th Sep 2018, 4:32 PM
Fareena Kakarla
Fareena Kakarla - avatar