Guest User

Untitled

a guest
Oct 22nd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. void main(void){
  4.  
  5. char buffer[20000];
  6. printf("ingrese texto:");
  7. fflush( stdin );
  8. scanf("%s",buffer);
  9.  
  10. char opcion[10];
  11.  
  12. printf("\nDesea guardar el archivo? presione G:");
  13. scanf("%s",opcion);
  14.  
  15. FILE *org;
  16.  
  17. if(strcmp(opcion,"g")==0){
  18. org = fopen("benjamin.txt","at");
  19. fprintf(org,"%s",buffer);
  20. fclose(org);
  21. printf("texto guardado\n");
  22. }
  23. else{
  24. printf("saliendo del programa sin guardar...\n");
  25. }
  26. }
Add Comment
Please, Sign In to add comment