Untitled
unknown
c_cpp
a year ago
442 B
8
Indexable
/*Esempio.txt
123 \n
456 \n
789 \n
101112 \n
*/
#include <stdio.h>
int main() {
FILE * file = fopen("Esempio.txt", "r");
if(file != NULL)
{
char s[200];
int number;
while(fgets(s, sizeof(s), file))
{
number = atoi(s);
printf("%d", number);
}
fclose(file);
}
else
{
printf("Errore apertura file");
}
return 0;
}Editor is loading...
Leave a Comment