confusingbird 2016-08-10 04:13 采纳率: 0%
浏览 1210
已结题

MFC 使用ifstream读取文件的时候“<<”不合法什么鬼

if (openFile(&fread, file))
{
    int count1 = 0;
    for (int count = 0; count < ROW; count++){
        fread >> str >> a[0] >> a[1] >> a[2];
        data[count1] = a[0];
        data[count1 + 1] = a[1];
        data[count1 + 2] = a[2];

        count1 += 3;
    }
    error C2678: binary '>>' : no operator defined which takes a left-hand operand of type 'class ifstream' (or there is no acceptable conversion)
  • 写回答

3条回答 默认 最新

  • confusingbird 2016-08-10 04:22
    关注

    这些代码不在MFC中运行是对的

    评论

报告相同问题?