Guest User

Untitled

a guest
Mar 15th, 2012
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. int myArray[8][8];
  2.  
  3. FILE *fp = fopen("board.txt", "rb");
  4. if(fp != NULL)
  5. {
  6. int x = 0;
  7. while( !feof(fp) )
  8. {
  9. if( x == 64 )
  10. break; //safety
  11.  
  12. myArray[(x-(x%8))/8][x%8] = fgetc(fp);
  13.  
  14. if(myArray[(x-(x%8))/8][x%8] != '\n')
  15. x++; //if it's not a newline increase x
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment