PREV INDEX NEXT

Author: Unknown
Subject: -t flag
Date: Wednesday, 29 Apr 2020, 10:09:05

Hi, 

I am trying to implement the -t flag with an global array, to keep track of whether I have visited a tile before, and if I did, then don't go into the if loop. 

Right now I have a int* track (set as global variable), calloced in main function according to the size of the board, and use it in traverse function. However, I keep having valgrind errors saying that reading track or writing to track is invalid. 

Is it okay to have a global array whose space is malloced in main? Does this approach sound right? 

Thank you very much!
PREV INDEX NEXT