Pointer-to-obect error//(int[int]) error

My code will compile and put the numbers in order but I getting errors on all the letters that are in the arrays. How do I get rid of this? Thank you.

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
37
38
39
40
41
42
43
44
45
  #include <iostream>

using namespace std;

int main()
{
	
	int Array;
	int minvalue;
	int minvalueindex;
	int size;
	int temp;
	cout << "use only variables between 0-20";

	for (int i = 0; i < 10; i++)
	{
		cout << "Enter value " << i++ << ":";
		cin >>  Array[i];
		if (Array[i] < 0 || Array[i]>20)
		{
			cout << "\n Invalid value try again";
			i--;
		}
	}
	for (int i = 0; i < size - 1; i++)
	{
		minvalue = Array[i];
		minvalueindex = i;
		for (int j = i; i < size - 1; i++)
		{
			if (minvalue > Array[j])
			{
				minvalue = Array[j];
					minvalueindex = j;
			}
		}
		temp = Array[0];
		Array[0] = Array[minvalueindex];
		Array[minvalueindex] = temp;
	}
	for (int k = 0; k < size - 1; k++)
	{
		cout << Array[k] << ",";
	}
}
int Array; cin >> Array[i];
so do I include "i" to my in the initialization?
so do I include "i" to my in the initialization?

No, do this :
int Array[0xDEAD];
Thank you it worked.
xxxxxxxxxxxxxxxxxxxxxxx

Actually when I tried it, it goes to value 0 to enter then value 2 then 4 and so on it worked at first but when I tried it again I got this problem now
Last edited on
Topic archived. No new replies allowed.