c - fscanf with string and long -


i'm trying parse file function has written fprintf:

fprintf(file, "ds;%s;%ld;%ld;%u\n", ds->name, ds->start, ds->period, ds->size) 

i'm using fscanf:

fscanf(file, "ds;%[^;$]s;%ld;%ld;%u", file_name, &file_start, &file_period, &file_size) 

file_name read no problems. file_start, file_period , file_size 0, if not expected.

for exemple, string:

ds;failures;1363978800;600;144 

is parsed this:

  • file_name: failures (ok)
  • file_start: 0 (ko)
  • file_period: 0 (ko)
  • file_size: 0 (ko)

what doing wrong?

replace string format "%[^;$]s" %[^;$] ==> remove s because [] replace s no need more s


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -