1
Vývoj / Re:Načtení 2D pole v C
« kdy: 20. 11. 2022, 22:14:04 »
Používám tuto konstrukci, čte celý řádek a pak řádek parsuje daným separátorem.
char *separator = " \t";
FILE *file = fopen( "jmeno_souboru.txt", "rt" );
fscanf( file, "%[^\n]s", line ); fgetc( file );
int index = atoi( strtok( line, separator ) );
double koef = atof( strtok( NULL, separator ) );
char *separator = " \t";
FILE *file = fopen( "jmeno_souboru.txt", "rt" );
fscanf( file, "%[^\n]s", line ); fgetc( file );
int index = atoi( strtok( line, separator ) );
double koef = atof( strtok( NULL, separator ) );