fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. const int X_SIZE = 40;
  5. const int Y_SIZE = 20;
  6. char buffer[Y_SIZE*(X_SIZE+1)+1];
  7. char *array[Y_SIZE];
  8. // Setup the buffer and the array
  9. for (int r = 0 ; r != Y_SIZE ; r++) {
  10. array[r] = &buffer[r*(X_SIZE+1)];
  11. for (int c = 0 ; c != X_SIZE ; c++) {
  12. array[r][c] = '#';
  13. }
  14. array[r][X_SIZE] = '\n';
  15. }
  16. buffer[Y_SIZE*(X_SIZE+1)] = '\0';
  17. printf("%s\n", buffer);
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0s 2156KB
stdin
Standard input is empty
stdout
########################################
########################################
########################################
########################################
########################################
########################################
########################################
########################################
########################################
########################################
########################################
########################################
########################################
########################################
########################################
########################################
########################################
########################################
########################################
########################################