Bienvenido a Tecnohackers

Tecnohackers » Programacion » Area de Programacion » Programacion a Bajo Nivel. APIs, Hooking, ASM, C/C++, etc.
 » 

Redireccionar scanf



Autor Tema: Redireccionar scanf  (Leído 877 veces)

Desconectado P4|3L0

  • Asiduo
  • *
  • Mensajes: 75
  • TecnoHacker un nuevo proyecto.
    • http://www.tecnohacker.com
Redireccionar scanf
« en: Diciembre 29, 2009, 11:05:32 am »
Código: You are not allowed to view links. Register or Login
#include <stdio.h>

FILE *archivo;

int main()
{
int num;
   printf("Introduce un numero: ");
   scanf( "%i", &num );
   archivo = fopen( "fscanf.txt", "a" );
   if( archivo == NULL )
      printf( "The file fscanf.txt was not opened\n" );
   else
   {

      fseek( archivo, 0L, SEEK_SET );
      fprintf( archivo, "%i", num);
      fclose( archivo );
   }
}



Tags:
Tags:

 


SMF 2.0.19 | SMF © 2016, Simple Machines
Paginas Afiliadas
Twitter - FaceBook - Daraxblog
Designed by Smf Personal