beginner stl basic_string question
-
i'm using the copy method of the basic_string. i'm a little confused about the first parameter. could someone please post a simple example of copying from one basic_string to another? thanks melinda
std::string str="hello heaven";
char buffer[1000];
str.copy(buffer,4); // copies "hell" without any terminating null characterJoaquín M López Muñoz Telefónica, Investigación y Desarrollo
-
std::string str="hello heaven";
char buffer[1000];
str.copy(buffer,4); // copies "hell" without any terminating null characterJoaquín M López Muñoz Telefónica, Investigación y Desarrollo
-
would it work the same way if i were copying from one basic_string to another basic_string? in that case i'm not actually using the string. melinda
Er, I do not understand completely your question.
copy
will work the same forbasic_string<TCHAR>
s, except that what it copies areTCHAR
s instead ofchar
s.copy
does ont have anything to do with copying from onebasic_string
to another. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo -
Er, I do not understand completely your question.
copy
will work the same forbasic_string<TCHAR>
s, except that what it copies areTCHAR
s instead ofchar
s.copy
does ont have anything to do with copying from onebasic_string
to another. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo