 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
我是最好的 Guest
|
Posted: Sun Jun 18, 2006 8:21 am Post subject: how to deal with this problem |
|
|
CString inputf="wc.txt";
CFile iFile( _T(inputf), CFile::modeCreate|CFile::modeReadWrite);
char buf[100*1024];
iFile.Read(buf,100*1024);
CString csml;
csml=buf;
csml.Replace(" <"," ");
iFile.Write(csml,strlen(csml));
iFile.Close();
//--------------------------------------------------------------------------------
this code reads the content of wc.txt to csml, and replace the
characters with " ", then save the result to wc.txt.
but unfortunately, bad things happen, the goal doesn't achieved.
i think the reason is the program can't find the end of the string
"\0".
i want to ask how to deal with it?
thanks very much! |
|
| Back to top |
|
 |
Jerry Coffin Guest
|
Posted: Sun Jun 18, 2006 8:43 am Post subject: Re: how to deal with this problem |
|
|
In article <1150600906.961101.27120
@p79g2000cwp.googlegroups.com>, dchen (AT) insun (DOT) hit.edu.cn
says...
[ MFC code elided ]
| Quote: | this code reads the content of wc.txt to csml, and replace the
characters with " ", then save the result to wc.txt.
but unfortunately, bad things happen, the goal doesn't achieved.
|
If you want some advice about how to do something at
least vaguely similar in a standard fashion, we might be
able to help out, but if you want advice about using MFC,
you'll probably need to ask somewhere that it's topical.
--
Later,
Jerry.
The universe is a figment of its own imagination. |
|
| Back to top |
|
 |
Ian Collins Guest
|
Posted: Sun Jun 18, 2006 8:46 am Post subject: Re: how to deal with this problem |
|
|
我是最好的 wrote:
[OT stuff]
Please don't multi-post. If you wish to post to more than one group,
cross-post.
--
Ian Collins. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|