Expression must have a pointer-to-object type error

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.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
 #include<iostream>
#include<fstream>
using namespace 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;
}
amplitude is an int, not an array. The array access operators only work with pointers, c-style arrays, or classes that have overloaded them.
Topic archived. No new replies allowed.