Question #2988   Proposée par Answiki le 28/11/2021 à 9:32:16 UTC

En C, comment insérer une tabulation dans une chaîne de caractères ?

Answer   Submitted by Answiki on 11/28/2021 at 09:33:15 AM UTC

En C, il existe un caractère spécial \t qui permet de définir une tabulation. Voici quelques exemples :

// La variable ch contient une tabulation
char ch='\t';

// Les deux mots de la chaîne sont séparés par une tabulation
char string[]="Une \t tabulation";

// Affiche 1, 2 et 3 séparés par des tabulations
printf ("1\t2\t3");


5 events in history
Answer by Answiki on 11/28/2021 at 09:33:15 AM

En C, il existe un caractère spécial \t qui permet de définir une tabulation. Voici quelques exemples :

// La variable ch contient une tabulation
char ch='\t';

// Les deux mots de la chaîne sont séparés par une tabulation
char string[]="Une \t tabulation";

// Affiche 1, 2 et 3 séparés par des tabulations
printf ("1\t2\t3");


Question by Answiki 11/28/2021 at 09:32:16 AM
Comment afficher une tabulation en C ?
Question by Answiki 11/28/2021 at 09:32:16 AM
En C, comment afficher une tabulation ?
Question by Answiki 11/28/2021 at 09:32:16 AM
En C, comment afficher une tabulation dans un printf ?
Question by Answiki 11/28/2021 at 09:32:16 AM
En C, comment insérer une tabulation dans une chaîne de caractères ?
# ID Query URL Count
0 7923 code c return une tabulation https://fr.ans.wiki/2988/en-c-comment-inserer-une-tabulation-dans-une-chaine-de-caracteres 1

Icons proudly provided by Friconix.