Line break is not working while writing csv file with CFile Visual Studio

144 Views Asked by At

here is my code:

//..
CString strWrite;                    // "VLF,3,30,100.000000,10.000000"
strWrite.Format(_T("%s,%d,%d,%f,%f\n"), str_aName[i], anFreq[i],anFreq[i+1], afWvLen[i], afWvLen[i+1]);
        
int n = strWrite.GetLength();        // 30
m_file.Write(strWrite.GetBuffer(), n);

by doing .Write(..\n) I want to save the next data (LF,30,300..) to the new line. But it's not working and saving like this:

enter image description here

any advices??

0

There are 0 best solutions below