void CountSort(int A[],int B[], int k, int size)
{
const int mx=k;
int C[mx];
...
}
try using new for this
void CountSort(int A[],int B[], int k, int size)
{
const int mx=k;
//int C[mx];//error:expression must have a constant value!!!
int* C = new int[k];//or new int[mx] anyway is fine
//You can use it as a normal arrray
C[somevalue]=someoperation;
...
}
and while you're at it do have a look at dynamic memory allocation.