fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int read_line(char buffer[],char dbuf[][]) {
  5. int i=0,b1=0,b2=0;
  6. while(buffer[i] != '\0') {
  7. if(buffer[i] != '\n') {
  8. dbuf[b1][b2++] = buffer[i++];
  9. }else {
  10. ++i;
  11. b2 = 0;
  12. dbuf[++b1][b2++] = buffer[i++];
  13. }
  14. }
  15. return 0;
  16. }
  17.  
  18. int print_double_array(char dbuf[][]) {
  19. int i1,i2;
  20. for(i1 = 0; dbuf[i1][0] != '\0';i1++) {
  21. for(i2 = 0; dbuf[i1][i2] != '\0'; i2++) {
  22. printf("%c",dbuf[i1][i2]);
  23. }
  24. putchar('\n');
  25. }
  26. return 0;
  27. }
  28.  
  29. int main(void) {
  30. int i2,i1;
  31. FILE *fp = fopen("rpl","w");
  32. char buffer[100],dbuf[20][20];
  33. for(i1 = 0; i1<20; i1++) {
  34. for(i2 = 0; i2 < 20; dbuf[i1][i2] = '\0');
  35. }
  36. fscanf(fp,"%s", buffer);
  37. read_line(buffer,dbuf);
  38. print_double_array(dbuf);
  39. return 0;
  40. }
  41.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:4: error: array type has incomplete element type
prog.c:18: error: array type has incomplete element type
prog.c: In function ‘main’:
prog.c:37: error: type of formal parameter 2 is incomplete
prog.c:38: error: type of formal parameter 1 is incomplete
prog.c:36: warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result
stdout
Standard output is empty