
ifstream infile;infile.open("sampleplanet");cout << (infile.good()); //prints a 1int levelLW = 0;int numLevels = 0;infile >> levelLW >> numLevels;cout << (infile.good()); //prints a 0 在第一个cout<< (infile.good());,它打印一个1,第二个打印0.这告诉我文件正确打开,但是一旦从中读入,infile就会失败.该文件具有足够多的行/字符,因此我无法通过该点尝试读取文件末尾. 文件内容:
82#level 2XXXXXXXXX......XX..X..XXX.X....XX..XX..XXXXX...XX...T..XXXX..XXX#level 1XXXXXXXXX......XX..X.XXXX.X..X.XX..XX..XX......XX^....SXXXX.^XXX解决方法 这是一个已知的错误.来自Xcode 3.2.1的 Release Notes:
总结The default gcc 4.2 compiler is not
compatible with the Standard C++
library DeBUG Mode. C++ programs
compiled with Xcode 3.2 may not work
in the DeBUG configuration. To fix
this,set the Compiler Version to 4.0,
or edit the DeBUG configuration’s
Preprocessor Macros and remove the
entrIEs:_GliBCXX_DEBUG=1 _GliBCXX_DEBUG_PEDANTIC=1
以上是内存溢出为你收集整理的c – 无法让ifstream在XCode中工作全部内容,希望文章能够帮你解决c – 无法让ifstream在XCode中工作所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)