en tout cas, ça marche avec gets(login); et cg = getchar(); de <stdio.h>.
Mais j'obtiens :
gcc essai.c -Wall -Wextra -pedantic -std=c99
essai.c: In function ‘main’:
essai.c:14:7: warning: ‘gets’ is deprecated [-Wdeprecated-declarations]
14 | gets(login);
| ^~~~
In file included from essai.c:1:
/usr/include/stdio.h:577:14: note: declared here
577 | extern char *gets (char *__s) __wur __attribute_deprecated__;
| ^~~~
et on peut lire dans stdio.h :
This function is impossible to use safely. It has been officially
removed from ISO C11 and ISO C++14, and we have also removed it
from the _GNU_SOURCE feature list. It remains available when
explicitly using an old ISO C, Unix, or POSIX standard.
# stdio.h
Posté par vmagnin (site web personnel, Mastodon) . En réponse au message problème avec la boucle do while. Évalué à 2.
Bonjour,
en tout cas, ça marche avec
gets(login);etcg = getchar();de<stdio.h>.Mais j'obtiens :
et on peut lire dans
stdio.h:This function is impossible to use safely. It has been officially
removed from ISO C11 and ISO C++14, and we have also removed it
from the _GNU_SOURCE feature list. It remains available when
explicitly using an old ISO C, Unix, or POSIX standard.
Je n'ai pas
conio.h, qui ne fait pas partie de la librairie standard (https://en.wikipedia.org/wiki/Conio.h).