./lab1 < inputFile | diff - outputFileWhere inputFile and outputFile will be one of these or a pair of your own creation.
void find(vector<string> grid, string word, int& returnX, int& returnY, int dx, int dy)Where returnX and returnY are the return values, and dx and dy are the change in the x and y coordinate for each letter. Checking vertically down would be dx=0 and dy=1, horizontally backward would be dx=-1 and dy=0, and rising diagonally to the right would be dx=1 and dy=-1. This greatly reduces the amount of redundant code you have to write.