Advertisement
silver2row

buffTwo

Sep 19th, 2023
881
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.61 KB | None | 0 0
  1. // From IBM and their ideas...
  2.  
  3. #define _XOPEN_SOURCE 500
  4.  
  5. #include <stdio.h>
  6. #include <signal.h>
  7. #include <errno.h>
  8. #include <stdlib.h>
  9. #include <string.h>
  10.  
  11. #ifdef __cplusplus
  12.     extern "C" {
  13. #endif
  14.  
  15. #ifdef __cplusplus
  16.     }
  17. #endif
  18.  
  19. int main(void) {
  20.    FILE *fp;
  21.    char buffer[80];
  22.    int i = 0;
  23.  
  24.    fp = fopen("testfull.txt", "w+");
  25.    if (fp == NULL) exit(99);
  26.  
  27.    memset(buffer, 'A', 80);
  28.  
  29.    /* write to MVS file until it runs out of extents */
  30.  
  31.    while (fwrite(buffer, 1, 80, fp) == 80)
  32.       ++i;
  33.  
  34.    printf("number of successful fwrites of 80 bytes = %d\n", i);
  35.  
  36.    return 0;
  37. }
Advertisement
Comments
  • lojatec8
    10 days
    # text 0.36 KB | 0 0
    1. Loja Tec8: Tecnologia e Inovação ao seu alcance.
    2.  
    3. Somos uma equipe apaixonada por oferecer uma experiência de compra simples e conveniente. Com uma seleção cuidadosamente escolhida de produtos de alta qualidade, buscando atender às suas necessidades. Desfrute da facilidade e segurança de comprar sem sair de casa.
    4.  
    5. https://lojatec8.com.br/
    6.  
    7. 55 11 93364-7934
Add Comment
Please, Sign In to add comment
Advertisement