benkas Posted May 7, 2008 Report Share Posted May 7, 2008 alguem conhece alg funcao que faca o mesmo que o gets ? Link to comment Share on other sites More sharing options...
Hipnoted Posted May 7, 2008 Report Share Posted May 7, 2008 Suponho que estejas a referir como ler input do teclado sem dar o Warning do gets... É assim: char var[50]; fgets(var,50,stdin); "Nunca discutas com um idiota. Eles arrastam-te até ao seu nível e depois ganham-te em experiência" Link to comment Share on other sites More sharing options...
benkas Posted May 7, 2008 Author Report Share Posted May 7, 2008 Assim ja funciona. Obrigadao Link to comment Share on other sites More sharing options...
suzy Posted May 7, 2008 Report Share Posted May 7, 2008 😛 ou entao fazes char nome[50]; printf(" qual o seu nome\n"); fflush(stdin); gets(nome); tb funciona 😄 Link to comment Share on other sites More sharing options...
Baderous Posted May 8, 2008 Report Share Posted May 8, 2008 😛 ou entao fazes char nome[50]; printf(" qual o seu nome\n"); fflush(stdin); gets(nome); tb funciona 😄 Ele queria uma alternativa ao gets e não o próprio gets com um fflush(stdin) antes. Link to comment Share on other sites More sharing options...
Rui Carlos Posted May 8, 2008 Report Share Posted May 8, 2008 Além do mais, o fflush não é para ser usado em buffers abertos para leitura. Rui Carlos Gonçalves 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