Convert all "\n" end-of-lines sequences to "\r\n" in a string.
bool check_convert_CR_str_to_CRLF( string & str )
Returns true if string changed otherwise false.
EX1
int check_convert_CR_str_to_CRLF_ex1() { //convert \n to \r\n string str = "hello\ngoodbye"; bool bRet = check_convert_CR_str_to_CRLF(str); if( bRet && 0 == strcmp(str, "hello\r\ngoodbye") ) printf("convert successfully"); else printf("fail to convert"); return 0; }
origin.h