ofstream outfile("图像像素.txt", ios::in | ios::trunc);报错,说ofstream 是未定义的标识符
#include#includeusing namespace std;
看一下你是否添加这个头文件 #include