From the error message in your comment:
(62): error C2143: syntax error : missing ';' before 'type' `
You are using a compiler that doesn't support C99, or you are not setting it in C99 mode. In C89, variables must be declared in the beginning of a block, so in this piece of code:
void randomizeArray (int mainArr [], int arraysize)
{
int seed = 10;/*Seed for the randon number operation*/
srand(seed);
int currPos = 0;
The variable currPos
must be declared before calling srand
:
void randomizeArray (int mainArr [], int arraysize)
{
int seed = 10;/*Seed for the randon number operation*/
int currPos = 0;
srand(seed);