I'm trying to fill and print with 2d array, yet every time I try to compile it says undeclared identifier c. And points an arrow at the c in the print function. I tried declaring it many ways yet for some reason it will not work.
#include <iostream>
using namespace std;
void print(char x[][c], int r)
{
for(int r = 0; r < 25; r++)
{
for(int c = 0; c < 25; c++)
{
cout << x[r][c];
}
cout << endl;
}
}
int main()
{
void print(char x[][c], int r);
char p[25][25];
for(int r = 0; r < 25; r++)
{
for(int c = 0; c < 25; c++)
{
if(r==0)p[r][c]='x';
else p[r][c]='o';
}
}
print(p[25][25]);
return(0);
}
c