} 其他 printf(?\\\\ n无法找到C:\\ X. TXT !!?); } int main() { PrintX(); } / *只有FUNCTION readrealylongtextline( )需要编写并且需要弄清楚逻辑问题 plz发布你的回复。 /*# ReadRealyLongTextLine() needs to be written (by you). The text line could be very very very very long!!! upto 30K characters or more than this # There is a logical error in the code ? you need to find it and fix it.*/ /***PrintX.cPrints the file C:\X.TXT line by line.*/ char * ReadRealyLongTextLine(File* p_fhInFile){ } void PrintX(void){ File* fhInFile; char *strLineBuf; fhInFile = fopen(?c:\\x.txt?, ?r?); if(fhInfile) { while( (strLineBuf = ReadRealyLongTextLine(fhInFile)) != NULL) printf(?%s?, strLineBuf); fclose(fhInFile); } else printf(?\r\nCould not find C:\\X.TXT!!?); }int main() { PrintX(); } /* only FUNCTION readrealylongtextline() needs to be written and the logical problem needs to be figured out plz do post ur replies . 嗨。我认为这部分: while((strLineBuf = ReadRealyLongTextLine(fhInFile))!= NULL) 是一个逻辑错误,因为赋值操作总是会评估真实,永远不会空白 这一部分 如果(fhInfile) 是语法错误(可能是拼写错误)Hi. I think this part:while( (strLineBuf = ReadRealyLongTextLine(fhInFile)) != NULL) is a logical error as an assignment operation will always evaluate to true and never to NULL this part if(fhInfile)is a syntax error (typo maybe) 我认为bug不在其他地方,你也需要编写函数ReadReallyLongTextLine()no i think bug is at some other place , also u need to write the function ReadReallyLongTextLine() 不,我认为bug在其他地方,你也需要编写函数ReadReallyLongTextLine() no i think bug is at some other place , also u need to write the function ReadReallyLongTextLine() 这个代码片段有效。也许你可以通过这个来解决问题的答案 this snippet works. Perhaps you can work out the answer to your problem from this 展开 | 选择 | Wrap | 行号 这篇关于C问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-18 17:44