hey guys reading deitel book and have a little problem with the code that I cant understand
#include <iostream>
using std::cout;
using std::endl;
#include <iomanip>
using std::setw;
int main()
{
// define array sizes
const int responseSize = 40; // size of array responses
const int frequencySize = 11; // size of array frequency
// place survey responses in array responses
int responses[ responseSize ] = { 1, 2, 6, 4, 8, 5, 9, 7, 8,
10, 1, 6, 3, 8, 6, 10, 3, 8, 2, 7, 6, 5, 7, 6, 8, 6, 7,
5, 6, 6, 5, 6, 7, 5, 6, 4, 8, 6, 8, 10 };
// initialize frequency counters to 0
int frequency[ frequencySize ] = { };
// for each answer, select value of an element of array
// responses and use that value as subscript in array
// frequency to determine element to increment
for ( int answer = 0; answer < responseSize; answer++ )
++frequency[ responses[answer] ];
// display results
cout << "Rating" << setw( 17 ) << "Frequency" << endl;
// output frequencies in tabular format
for ( int rating = 1; rating < frequencySize; rating++ )
cout << setw( 6 ) << rating
<< setw( 17 ) << frequency[ rating ] << endl;
return 0; // indicates successful termination
} // end main
OK , please tell me about these things , what happents when we say int frequenct[frequencysize] = {} . does it do a thing or if it doesent why should the writer put that bracket open and bracket close , he could have not writen it , and the second part is ++frequent [ responses[answer]] two things about it first of all what will be ++ and a little talking about it , like which element in array will change ? thats all tnx