<分区>
今天早上发现一个很奇怪的问题,一直找不到解决办法。请帮我用下面的代码解决这个问题(使用 Visual Studio C++ 和 MFC):
FILE *fp = NULL;
//fp = fopen(mmFileName , "a");
//Store the module directory path
fopen_s( &fp , "TempWorking.xml" , "wb");
//char* TempChar;
CString strtempff;
strtempff = "\"<article> <section class="page"><p>Writing for the clown show that is <em>Forbes</em>, Darcy Travlos asks the <a href="http://en.wikipedia.org/wiki/Betteridge%27s_law_of_headlines">Betteridge’s Law</a>-challenging question “Apple And Google: The New ‘Old’ Reality?†(No link but tip o’ the an";
char* TempArray;
TempArray = new char[strtempff.GetLength()];
strcpy(TempArray,strtempff.GetString());
strtempff = "";
strtempff.Empty();
fprintf(fp,(char*)TempArray);
我不知道为什么我的代码在 fprintf()
语句中不起作用:它给了我一个调试断言。 strtempff
摘自网络,仅作为示例代码