Home > Back-end >  In the file less a newline
In the file less a newline

Time:10-07

CMMSeg AD;
GetDlgItemText (IDC_EDIT3 m_str2);
If (m_str2!="")
{
M_str2 +="\ r \ n";
A. The add (m_str2);
M_str2="";
SetDlgItemText (IDC_EDIT2 m_stre);
SetDlgItemText (IDC_EDIT3 m_stre);

}


Void CMMSeg: : add (cstrings str2)
{
Dic. TXT FILE * dict=fopen (" ", "a");
The fputs (str2, dict);
The fclose (dict);
}

Example:
In the document had a "today" add the word "tomorrow"

Are shown in the document:
Today and tomorrow

Want to display:
Today
Tomorrow

CodePudding user response:

 FILE * dict=fopen (" dic. TXT ", "a"); 
The fputs (str2, dict);
The fputs (" \ n ", dict);
The fclose (dict);

CodePudding user response:

reference 1st floor ksrsoft response:
 FILE * dict=fopen (" dic. TXT ", "a"); 
The fputs (str2, dict);
The fputs (" \ n ", dict);
The fclose (dict);


Tried, and there's no way.
M_str2 +="\ r \ n"
Why can't this sentence

CodePudding user response:

When open the file with fopen (name, "at");
  • Related