I have problem with a static variable.
I tried to make maze program by using stack.
At first, It activateit activates currently when I put all codes in same source file.
But after I separate main to main.cmain.c source, and other functions to function.cfunction.c, an an error occurred at static variable.
thisThis is partspart of code in function.cfunction.c file that problem happen.
I used EXIT_ROWEXIT_ROW and EXIT_COLEXIT_COL as static variable, and these initialized at main function. And I use EXIT_ROWEXIT_ROW and EXIT_COLSEXIT_COLS at other function.cfunction.c file but when I do debugging this file, EXIT_ROWEXIT_ROW and EXIT_COLEXIT_COL didn't ititializeinitialize at all.
void main() { int xsize, ysize; FILE*FILE fp;*fp; if( !( fp = fopen("input.txt", "r") ) ) { fprintf(stderr, "FILE couldn't open\n"); exit(EXIT_FAILURE); }; fscanf(fp, "%d %d", &ysize, &xsize); EXIT_ROW = ysize; EXIT_COL = xsize; printf("%d %d\n", ysize, xsize); init_maze(xsize, ysize, fp); print_maze(xsize, ysize); path(); } I couldn't understand why it happened.. EXIT_ROW and EXIT_COLS are declaireddeclared in stack.h header file. can u help me why it happendhappened, and how can I fix it?