1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <time.h>
/* Déclarations : */
FILE *p_fichier_sortant; /* pointeur sur FILE */
FILE *p_fichier_sortant_2; /* pointeur sur FILE */
char NOM_FICHIER_sortant[30];
char NOM_FICHIER_sortant_2[30];
char porteur [16];
char prenom [6];
char montant [6];
char date [6];
char heure [6];
char secu[0];
main()
{
/* Création du fichier en lecture */
cout<<("creation du fichier : ");
cin>>NOM_FICHIER_sortant;
cout<<("Nom :");
cin>>porteur;
cout<<("prenom :");
cin>>prenom;
cout<<("Montant sur 5 caracteres :");
cin>>montant;
cout<<("date format aammjj :");
cin>>date;
cout<<("heure format hhmmss :");
cin>>heure;
//cout<<("creation du fichier : ");
//cin>>NOM_FICHIER_sortant_2;
cout<<("secu : ");
cin>>secu;
p_fichier_sortant = fopen(NOM_FICHIER_sortant, "wr");
fprintf(p_fichier_sortant,"<>08lololo70 0");
fprintf(p_fichier_sortant,porteur);
fprintf(p_fichier_sortant,"EUR00000");
fprintf(p_fichier_sortant,montant);
fprintf(p_fichier_sortant,date);
fprintf(p_fichier_sortant,"00000000000000000 90000000000000000000 00");
fprintf(p_fichier_sortant,date);
fprintf(p_fichier_sortant,"00000001000070000000000000000000000000000");
fprintf(p_fichier_sortant,montant);
fprintf(p_fichier_sortant,"000000000000000097800 ");
fprintf(p_fichier_sortant,date);
fprintf(p_fichier_sortant,heure);
fprintf(p_fichier_sortant,porteur);
fprintf(p_fichier_sortant,"000@@@@ ");
fprintf(p_fichier_sortant,prenom);
fprintf(p_fichier_sortant," 0000");
fprintf(p_fichier_sortant,secu);
fprintf(p_fichier_sortant," 000000 00 A\n");
fclose(p_fichier_sortant);
//p_fichier_sortant_2 = fopen(NOM_FICHIER_sortant_2, "wr");
//fprintf(p_fichier_sortant_2,"040 ");
//fprintf(p_fichier_sortant_2,dinul);
//fprintf(p_fichier_sortant_2,"0000v");
//fprintf(p_fichier_sortant_2," 00");
//fclose(p_fichier_sortant_2);
return 0;
} |
Partager