Hey everyone I'm getting the error: expression must have pointer to object type. I'm supposed to be reading data from a .txt file. It's supposed to be for audio fingerprinting so I need to use a counter to move through the bins in the frames and find the maximum amplitude in the bin. I'm getting stuck on the counter with this error however. Any ideas on how to fix it? Note: the code is incomplete.
#include<iostream>
#include<fstream>
usingnamespace std;
int main()
{
int frame = 0;
int bin = 0;
int counter=0, amplitude;
ifstream audioFile;
audioFile.open("audioframes.txt");
int data;
audioFile >> data;
if (!audioFile.is_open()) {
cout << "Failure to open file." << endl;
}
else {
cout << "File opened successfully. Data is being analyzed..." << endl;
if (counter%3==2)
{
amplitude[frame][bin] = data;
bin++;
}
if((frame!=24))
for (int j = 0; j < 25600; j++);
}
cout << data << endl;
return 0;
}