Code:
#include <iostream>
using std::cout;
using std::endl;
using std::cin;
int main ( void )
{
int ta = 0;
int tc = 0;
int survey1[11] = { 1, 5, 10, 8, 4, 4, 2, 10, 7, 6 };
char survey2[21] = { 'm', 'f', 'f', 'm', 'f', 'f', 'f', 'm', 'm', 'f',
'm', 'f', 'm', 'm', 'm', 'm', 'm', 'f', 'f', 'm' };
int survey3[51] = { 1, 2, 1, 2, 2, 2, 1, 1, 1, 1,
2, 1, 2, 1, 1, 1, 2, 2, 1, 2,
1, 2, 1, 1, 1, 2, 2, 2, 2, 2,
1, 2, 1, 2, 1, 1, 1, 1, 1, 2,
1, 2, 1, 2, 1, 2, 1, 1, 2, 2 };
cout << "\tStudent survey result program:\n\n";
for ( int i = 0; i <= 10; ++i )
cout << "Survey 1[] = " << survey1[i] << endl;
ta += survey1; // ERROR LINE
cout << "\n\n\n";
for ( int i = 0; i <= 20; ++i )
cout << "Survey 2[] = " << survey2[i] << endl;
cout << "\n\n\n";
for ( int i = 0; i <= 50; ++i )
cout << "Survey 3[] = " << survey3[i] << endl;
cout << "\n\n\n";
cout << "Total of survey 1 is: " << ta << endl
<< "\nTotal of survey 3 is: " << tc << endl;
cin.get();
return 0;
}
I do not know what the new look up error is, I have never seen