Code:
#include<stdio.h>
#include<stdlib.h>
int main(void)
{
int x;
int y;
int startx;
int starty;
int finishx;
int finishy;
char a;
int tempx=0;
int tempy=0;
scanf("%d %d", &y, &x);
char maze[x][y];
for(;tempx<=x;tempx++)
{
fgets(maze[tempx],y+2,stdin);
}
for(tempx=1;tempx<x+1;tempx++){
for(tempy=0;tempy<y;tempy++){
a=maze[tempx][tempy];
if(a=='o')
{
printf("start position: %d %d\n", tempx, tempy);
startx=tempx;
starty=tempy;
}
if(a=='*')
{
printf("end position: %d %d", tempx, tempy);
finishx=tempx;
finishy=tempy;
}
}
}