Sota Posted November 20, 2009 at 07:18 PM Report Share #297045 Posted November 20, 2009 at 07:18 PM printf("Funcao da estacao n %d: \n",estacoes[j]); scanf("%c",&s); printf("\ntecla: %c*",s); while(s!='s' && s!='e'){ printf("Funcao da estacao n %d: \n",estacoes[j]); scanf("%c",&s); printf("\ntecla: %c",s); } modo[j]=s; Quero ler uma variavel, mas ele passa por cima do do primeiro scanf. só para no segundo. Tou a utilizar o scanf porque já experimentei o getchar(), mas tambem não dá? como posso fazer isso ??? Link to comment Share on other sites More sharing options...
Baderous Posted November 20, 2009 at 07:28 PM Report Share #297047 Posted November 20, 2009 at 07:28 PM Provavelmente tens de limpar o buffer de entrada: scanf("%*c"); Coloca isto antes de cada scanf a ver se resolve. Link to comment Share on other sites More sharing options...
Sota Posted November 21, 2009 at 01:09 PM Author Report Share #297083 Posted November 21, 2009 at 01:09 PM Resultou obrigado 🙂 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now