For Programmers: Free Programming Magazines  


Home > Archive > C > February 2006 > Re: do {...} while () ;









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: do {...} while () ;
Aleramo

2006-02-26, 7:55 am

Maybe i made a few of confusion. I addict some rows before:

char scelta_array [10], scelta_piano ;

puts ("Scrivere:\n* lineare, per studiare un array lineare;") ;
puts ("* piano, per studiare un array piano;") ;
puts ("* qualunque altra parola per uscire.") ;
gets (scelta_array) ; /* Con scanf () non funziona!!! con gets
d=E0 il messaggio di worning ma non ga eco. */

do {
printf ("\nCome devono essere posizionati gli elementi?\n") ;
printf ("* premere E, nel caso di posizionamento sul piano
E\n") ;
printf ("(ricezione onde orizzontali);\n") ;
printf ("* premere H, nel caso di posizionamento sul piano
H\n") ;
printf ("(ricezione onde verticali).\n") ;
scanf ("%c", &scelta_piano) ;
} while ((scelta_piano !=3D 'H') && (scelta_piano !=3D 'h') &&
(scelta_piano !=3D 'E') && (scelta_piano !=3D 'e')) ;

Before i used:

scanf ("%s", scelta_array) ;

and i substituted it with:

gets (scelta_array) ;

I receive the message of Worning for gets (), but i can execute the
program withouth any problems. My question is: have you thought i
changet the scanf () in the cycle with the gets () ? it's the gets ()
there ok? or you advise me to change the solution?

Thank you to everyone!!!
Aleramo.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com