I am writing in C, not C++ or C# How can open additional array inside a function and put 0 in all its elements in one line only?
at the moment i have errors
Error 1 error C2065: 'new' : undeclared identifier
Error 3 error C2143: syntax error : missing ';' before 'type'
Error 4 error C2143: syntax error : missing ';' before '['
all errors at the same place - at the declaration of the new array
void dup(int a[], int n)
{
int i;
int *t = new int[n];
for(i=0; i<=n; i++)
t[i] = 0;
for(i=0;i<n;i++)
t[a[i]]++;
}