Rearranging an array

I am trying to make a function that rearranges an array and returns a new table.

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
46
47
48
49
50
51
#include <iostream>
using namespace std;

template <class T,size_t S>
int ArraySize(T (&Table)[S])
{
	return sizeof(Table)/sizeof(*Table);
}

template <class T,size_t S>
int FindHighest(T (&Array)[S])
{
	T Highest=0;
	for (int i=0 ; i<ArraySize(Array) ; i++)
	{	
		if (Highest<Array[i])
		Highest = Array[i];
		Array[i]=0;
	}
	
	return Highest;
}

template <size_t S>
int RA(int (&Table)[S])
{
	int TSize = ArraySize(Table);
	int Arranged[TSize];
	
	for (int Re=0 ; Re!=TSize ; Re++)
	{
		Arranged[Re]=FindHighest;
	}
	
	return Arranged;
}

int main()
{
	int Original[]={5,2,7,2,1,8,7,3,9,0};
	int Second[ArraySize(Original)];
	
	Second = RA(Original);
	
	for (int i=0 ; i<ArraySize(Second) ; i++)
	{
		cout << Second[i] << endl;
	}
	
	return 0;
}


I am still not familiar with what the error means.

43	9	[Error] incompatible types in assignment of 'int' to 'int [(((sizetype)<anonymous>) + 1)]
45	35	[Error] no matching function for call to 'ArraySize(int [(((sizetype)<anonymous>) + 1)])
32	15	[Error] cannot resolve overloaded function 'FindHighest' based on conversion to type 'int'
35	9	[Error] invalid conversion from 'int*' to 'int' [-fpermissive]


Thank you in advance.
closed account (38qG1hU5)
I'm fairly new to c++ but I'm pretty sure You never defined what Second = RA(Original); is: String, Char, Int, ect...
You never defined what Second = RA(Original); is


Did,

1
2
3
4
5
	
	int Original[]={5,2,7,2,1,8,7,3,9,0};
	int Second[ArraySize(Original)];
	
	Second = RA(Original);
Topic archived. No new replies allowed.