Add a carriage return to the cstring type data!

zhaozj2021-02-16  52

The character of the specified location cannot be directly accessed directly, all to get the string pointer to getBuffer, then add a carriage return at the end of the string, the wrap character (the ASCII code of the Enter is 13, the wrap ASCII code is 10);

Example code:

CSTRING STRTEMP; LPTSTR PSTR;

INT Nlen = strTemp.getLength (); pstr = strTemp.getBuffer (Nlen 2); PSTR [NLEN] = 13; PSTR [NLEN 1] = 10; strTemp.ReleaseBuffer ();

转载请注明原文地址:https://www.9cbs.com/read-16276.html

New Post(0)