+ 2
string bytes
how many bytes string is? i want to import an int to a string. is that possible?
4 Respuestas
+ 6
"size of a String includes number of characters you enter and a null character"
Wrong! In C++'s basic string class, null terminator won't be appended to the end of the sequence.
string s = "Hi";
cout << "Length of s: " << s.length(); // 2
~~~~~~~~~
"i think it is not possible to convert int to string but [...]"
What are you talking about?! 8D
std::to_string
Converts a numeric value to std::string
[See example in the below link]
____
https://en.cppreference.com/w/cpp/string/basic_string/to_string
+ 6
i think it is not possible to convert int to string but ya we can import int to char
+ 3
The question is about C++ and `string`! 8D
+ 2
not even like this?
int a =1;
string = a;