fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #define X (10)
  4. #define Y (10)
  5. #define XY (X*Y)
  6. int main(void) {
  7. static char buf[XY] = {0x20} ;
  8. char (*mtx)[X] = (char(*)[X])buf;
  9. FILE* fp;
  10. int c,i,x,y;
  11. fp = fopen("hoge","r");
  12. for (c=i=0 ; (c=getc(fp))!=EOF && i<XY ; ) {
  13. if (c>=0x20) buf[i++] = c;
  14. }
  15. for (y=0 ; y<Y ; y++) {
  16. for (x=0 ; x<X ; x++) {
  17. printf("%c",mtx[y][x]);
  18. } printf("\n"); }
  19. return 0;
  20. }
  21.  
Runtime error #stdin #stdout 0s 9424KB
stdin
Standard input is empty
stdout
Standard output is empty