Exercice en c
Résolu
nona
-
holow1 Messages postés 739 Statut Membre -
holow1 Messages postés 739 Statut Membre -
Bonjour, je veux de l'aide pour ouvrir ce exercice:fait un programme qui:
1.créature d'un fichier
2.ajout
3.modifier
4.aficher
5.supprimer
et merci.
1.créature d'un fichier
2.ajout
3.modifier
4.aficher
5.supprimer
et merci.
A voir également:
- Exercice en c
- Transmath 3eme exercice - Forum Loisirs / Divertissements
- Corrigés 350 exercices niveau moyen ✓ - Forum Loisirs / Divertissements
- Cahier transmath 3° ex 6p37, 6et7p27 et 5p65 svp c'est urgent! ✓ - Forum Études / Formation High-Tech
- Le corrigé de cet exercice - Forum Programmation
- Fleur d'encre 5eme corrigé exercice ✓ - Forum PDF
2 réponses
désolé, CCM n'est pas à ta disposition pour faire tes exercices : https://www.commentcamarche.net/infos/25899-demander-de-l-aide-pour-vos-exercices-sur-ccm/
creation fichier
#include <stdio.h>
main()
{
char nomfich[21] ;
int n ;
FILE * sortie ;
printf ("nom du fichier à créer : ") ;
scanf ("%20s", nomfich) ;
sortie = fopen (nomfich, "w") ;
do { printf ("donnez un entier : ") ;
scanf ("%d", &n) ;
if (n) fwrite (&n, sizeof(int), 1, sortie) ;
}
while (n) ;
fclose (sortie) ;
}
affichage ;
#include <stdio.h>
main()
{
char nomfich[21] ;
int n ;
FILE * entree ;
printf ("nom du fichier à lister : ") ;
scanf ("%20s", nomfich) ;
entree = fopen (nomfich, "r") ;
while ( fread (&n, sizeof(int), 1, entree), ! feof(entree) )
printf ("\n%d", n) ;
fclose (entree) ;
}
#include <stdio.h>
main()
{
char nomfich[21] ;
int n ;
FILE * sortie ;
printf ("nom du fichier à créer : ") ;
scanf ("%20s", nomfich) ;
sortie = fopen (nomfich, "w") ;
do { printf ("donnez un entier : ") ;
scanf ("%d", &n) ;
if (n) fwrite (&n, sizeof(int), 1, sortie) ;
}
while (n) ;
fclose (sortie) ;
}
affichage ;
#include <stdio.h>
main()
{
char nomfich[21] ;
int n ;
FILE * entree ;
printf ("nom du fichier à lister : ") ;
scanf ("%20s", nomfich) ;
entree = fopen (nomfich, "r") ;
while ( fread (&n, sizeof(int), 1, entree), ! feof(entree) )
printf ("\n%d", n) ;
fclose (entree) ;
}
tu peux relire cet article aussi : https://www.commentcamarche.net/infos/25899-demander-de-l-aide-pour-vos-exercices-sur-ccm/