43 if (fgets(buf,
sizeof(buf), stdin) != NULL)
45 i = (int) strtol(buf, &p, 10);
47 if (!(buf[0] !=
'\n' && (*p ==
'\n' || *p ==
'\0')))
49 printf (
"Il dato inserito non e' un intero. Reinserire.\n");
80 if (fgets(buf,
sizeof(buf), stdin) != NULL)
82 d = strtod(buf, NULL);
84 if ( strtod(buf, NULL) == 0 && (buf[0] !=
'0' && (buf[0] !=
'\0' && buf[0] !=
'-' && buf[1] !=
'0')) )
87 printf (
"Il dato inserito non e' un double. Reinserire.\n");
110 if ( (fgets(s, BUFSIZ, stdin) != NULL) && (s != NULL) )
134 if (fgets(letta, BUFSIZ, stdin) != NULL)
136 if ((p = strchr(letta,
'\n')) != NULL)
int leggi_str(String msg, String letta)
Legge una riga da terminale.
double leggi_double(String msg)
Legge un reale da terminale.
char leggi_car(void)
Legge un carattere da terminale.
int leggi_int(String msg)
Legge un intero da terminale.
Contiene funzioni di utilità per elaborare stringhe.
char String[BUFSIZ]
Definisce il String.