/* Efface l'ecran */ void effaceEcran(void) { int indexLigne; for (indexLigne = 0; indexLigne < NombreLignesEffacageEcran; ++indexLigne) { sautDeLigne(); } }
void EcranV::afficherMot(const char *mot,Couleur prPlan) { int i=0; while(mot[i]!='\0'){ // '\0' : caractère de fin if(mot[i] == '\n'){ // '\n' : passage à la ligne sautDeLigne(); }else afficherCaractere(prPlan,arrierePlan, mot[i]); i++; } //afficherCurseur(); }
void EcranV::miniprintf(char *fmt, ...) { va_list ap; char *p; int ival; // double dval; char c; char *s; va_start(ap, fmt); for (p = fmt; *p; p++) { if (*p != '%') { if(*p == '\n') sautDeLigne(); else if(*p == '\t') afficherMot(" "); else afficherCaractere(BLANC,NOIR,*p); continue; } switch (*++p) { case 'd': ival = va_arg(ap, int); afficherChiffre(ival); break; case 'c' : c = va_arg(ap, int); afficherCaractere( BLANC,NOIR,c ); break; case 's' : s = va_arg(ap, char *); for ( ; *s != '\0'; s++ ) afficherCaractere( BLANC,NOIR,*s ); break; default: break; } } va_end(ap); }