« Mathc initiation/Fichiers h : x 15 » : différence entre les versions
Contenu supprimé Contenu ajouté
nouveau chapitre |
mAucun résumé des modifications |
||
Ligne 1 : | Ligne 1 : | ||
[[Catégorie:Mathc initiation (livre)]] |
[[Catégorie:Mathc initiation (livre)]] |
||
[[Mathc_initiation/Fichiers_h_:_c15|Sommaire]] |
|||
Installer ce fichier dans votre répertoire de travail. |
Installer ce fichier dans votre répertoire de travail. |
Version du 4 juillet 2021 à 14:39
Installer ce fichier dans votre répertoire de travail.
x_hfile.h utilitaire |
---|
/* ------------------------------------ */
/* Save as : x_hfile.h */
/* ------------------------------------ */
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <ctype.h>
#include <time.h>
#include <math.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 nlign(int n)
{
int i;
for(i=0;i<n;i++)
printf("\n");
}
/* ------------------------------------ */
void stop(void)
{
printf(" Press return to continue. ");
getchar();
}
/* -------------- Into a while() loop - */
int stop_w(void)
{
printf("\n Press return to continue");
printf("\n Press X to stop ");
return(toupper(getchar())!='X');
}
/* ---------------------------------- */
/* ----------------------------------
Call : time_t t;
int i;
srand(time(&t));
i = rnd_I(9);
---------------------------------- */
int rndp_I(
int maxI)
{
return((rand() % maxI) + 1);
}
Ce fichier contient la bibliothèque des utilitaires.
Il y a une nouvelle fonction "void nlign(int n);", cette fonction permet d'ajouter des lignes vides dans l'écran à la place de la commande "\n".