Using the suggestion given in the other solution, I provide an implementation that compiles and runs.
#include <iostream>
using namespace std;
void fun( char * array, int size, int row, int col)
{
char replacement[] = {'\\','|','/','-','\0'};
int index = size * row + col;
if ( row == 0)
{
if (col == 0)
array[index] = replacement[0];
else
array[index] = replacement[2];
}
else
{
if (col == 0)
array[index] = replacement[2];
else
array[index] = replacement[0];
}
}
int main()
{
char chr[5][5];
for(int i=0; i<5; i++)
{
for(int j=0; j<5;j++)
{
fun((char*)chr, 5, i, j);
cout << chr[i][j];
}
cout<<endl;
}
return 0;
}
It produces the following output
\/\\\\
/\\\\
/\\\\
/\\\\
I don't know if it is the
expected output, since I had to infer the requirements from your code.