| 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.
|