2016-04-04 12 views
-4

私は自分のコードに問題があるエラー: '<<演算子' の一致なし(オペランドの型がある 'のstd :: basic_ostream <char>'

void viewall(struct student st[], int itemcount) 
{ 
    int i = 0; 
    cout << left << setw(5) << "ID" << setw(20) << "NAME" << setw(5) << "SEX" 
      << setw(5) << "Q1" << setw(5) << "Q2" << setw(5) << "AS" << setw(5) 
      << "MI" << setw(5) << "FI" << setw(5) << "TOTAL" << "\n"; 
    cout 
      << "========================================================================\n"; 

    while (i <= itemcount) 
    { 

     if (st[i].stnumber != "") 
     { 

      cout << left << setw(5) << st[i].stnumber << setw(20) 
        << st[i].stname << setw(5) << st[i].sex << setw(5) 
        << st[i].quiz1 << setw(5) << st[i]quiz2 << setw(5) 
        << st[i].assignment << setw(5) << st[i].midterm 
        << setw(5) << st[i].finale << setw(5) << st[i].total 
        << "\n"; 
     } 

     i = i + 1; 
    } 

} 

error: no match for ‘operator<<’ (operand types are ‘std::basic_ostream<char>’ < ----それはです。

[...] << st[i]quiz2 << [...]

I:?私はあなたがタイプミスを持っているように見えます

+0

。 – LogicStuff

+1

長い線と貧弱な刻み目は、エラーを必要以上に見つけにくくしました。良いコードスタイルは、起こる前に多くのバグを止めることができます。 – user4581301

答えて

1

何をすべきか、私が得たエラーtは、より可能性が高いはずです:完全なエラーメッセージはありません

[...] << st[i].quiz2 << [...]

注意.(ドット)

関連する問題