Installer ce fichier dans votre répertoire de travail.
z_s.h clrscrn, stop, stop_w, pause |
---|
/* ------------------------------------ */
/* Save as : z_s.h */
/* ------------------------------------ */
/* ------------------------------------ */
void clrscrn(void)
{
printf("\n\n\n\n\n\n\n\n\n\n"
"\n\n\n\n\n\n\n\n\n\n"
"\n\n\n\n\n\n\n\n\n\n");
}
/* ------------------------------------ */
void stop(void)
{
printf(" Press return to continue. ");
fflush(stdout);
getchar();
}
/* ------------------------------------ */
int stop_w(void)
{
printf("\n Press return to continue");
printf("\n Press X to stop ");
fflush(stdout);
return(toupper(getchar())!='X');
}
/* ------------------------------------ */
void pause(void)
{
int i=0;
int j=400;
while(--j)
{i=200000;
while(--i);
}
}
/* ------------------------------------ */
La fonction clrscrn(); efface l'écran en introduisant des lignes vides.
La fonction stop(); arrête le programme.
La fonction stop_w(); arrête un boucle while() ou do while().
Si on souhaite arrête le programme sans affichage à l'écran on peut directement utiliser getchar();
Des exemples sont donnés après la déclaration de tous les fichiers .h
Cet article est issu de Wikibooks. Le texte est sous licence Creative Commons - Attribution - Partage dans les Mêmes. Des conditions supplémentaires peuvent s'appliquer aux fichiers multimédias.