Error while writing code for counting sort

#include
#include
#include
using namespace std;
void printArray(int *a,int n)
{
for(int i=0;i<n;i++)
cout<<a[i]<<" ";
cout<<endl;
}

int* countSort(int *a,int n)
{
int range=*max_element(a,a+n);
cout<<“1. range:”<<range;

int *count;
memset(count,0,range);
for(int i=0;i<range;i++)
	cout<<"2. initialize to 0:"<<*(count+i);

for(int i=0;i<n;i++)
	count[a[i]]++;
for(int i=0;i<range;i++)
	cout<<"2. initialize to 0:"<<*(count+i);

for(int i=0;i<range;i++)
	count[i]+=count[i-1];
for(int i=0;i<range;i++)
	cout<<"2. initialize to 0:"<<*(count+i);
int b[n];
for(int i=n;i>=1;i--)
{
	b[count[a[i]]]=a[i];
	count[a[i]]-=1;
}

return b;

}
int main()
{
int n,a[100];

cin>>n;
for(int i=0;i<n;i++)
	cin>>a[i];

printArray(a,n);
int*b=countSort(a,n);
printArray(b,n);

}

Not able to get any output for b and count array

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.