Hello.
this is code of piece of my program:
Code:
FILE *fp;
if((fp = fopen("prog_conf.txt", "r")) == NULL)
{
printf ("\nNie mogę otworzyć pliku prog_conf.txt do zapisu!");
return NULL;
}
printf ("\nPlik otwarto!\n");
while( fscanf(fp,"%s#%s",optionName,optionValue) != EOF)
{
printf("\n%s : %s",optionName,optionValue);
}
fclose(fp);
and here is structure of prog_conf.txt file:
Code:
log_file#log.txt
mysql_server#localhost
mysql_user#root
mysql_pass#asd
mysql_db#schoolSubjects
defaultnumquest#5
If I use format as %s#%s then whole first part of file line is writing to variable optionName. I don't know what is wrong. I want to write first part of line(before #) to variable optionName and secound part of line (after #) to variable optionValue. Can you help me with that?:/