what is the difference between the cin.getline() function and getline() function?
declaring cin.getline() vs getline()
Collapse
X
-
I'm pretty sure you can create a C++ string (std::string) using a cstring as its parameter - something like:
As for making a cstring from an std::string, there may be a function within std::string to return the character array, or you could simply create your own by iterating through the characters of the string and assigning them to an element in a cstring.Code:char mycstr[20] = "Hello Guys!\0"; std::string mystr(mycstr);
Comment
Comment