-2
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
int A;
ifstream file("file.txt"); // there is a single "8" in the file
file >> A;
cout << A; // I get 0 always
return 0;
}
虽然我并不陌生CodeBlocks,但我是Mac上的CodeBlocks的新手。我已经更改了“执行工作目录”,但它仍然无效,请帮助。Mac上的CodeBlocks没有读取文件
我以前看过我们应该在build目标属性中设置执行目录看看。 – 13krn