benkas Posted May 7, 2008 at 01:52 PM Report Share #183778 Posted May 7, 2008 at 01:52 PM 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 at 02:00 PM Report Share #183781 Posted May 7, 2008 at 02:00 PM 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 at 02:10 PM Author Report Share #183787 Posted May 7, 2008 at 02:10 PM Assim ja funciona. Obrigadao Link to comment Share on other sites More sharing options...
suzy Posted May 7, 2008 at 11:58 PM Report Share #183924 Posted May 7, 2008 at 11:58 PM 😛 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 at 12:36 AM Report Share #183929 Posted May 8, 2008 at 12:36 AM 😛 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 at 10:48 AM Report Share #183957 Posted May 8, 2008 at 10:48 AM 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