This is about my snake clone again. I figure it goes here instead of Game Programming because it's more about C in general than Game specific stuff.
Code:
fseek(stdout, 80 * (snakepos[0][1] - 1) + snakepos[0][0], SEEK_SET);
fscanf(stdout, "%c%c", &test[0], &test[1]);
if ((test[0] != 32 || test[1] != 32) && (test[0] != apple[0] && test[1] != apple[1]))
alive = 0;
Anyway what I'm trying to do here is to go to the line where the head of the snake is, and before it moves there it gets which characters is placed there, if it's not spaces or an apple you'll die. Problem is that after fscanf, test[0] and test[1] will contain 0 (null) and I don't know why. I tried changin the position with a constant like, 3, but it still gave me zeroes.
Am I doing something wrong or is it just not possible?