Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!cernvax!marty From: marty@cernvax.cern.ch (hugues marty) Newsgroups: comp.lang.c Subject: Problem with sscanf Summary: Why is sscanf("1,,3", "%[^,],%[^,],%[^,]", s1, s2, s3) wrong?s Keywords: sscanf Message-ID: <4058@cernvax.cern.ch> Date: 5 Feb 91 09:55:27 GMT Organization: CERN, European Laboratory for Particle Physics Lines: 15 I'm having problem with sscanf. I would like to get items in a string delimited by a coma. So I wrote : sscanf("1,,3", "%[^,],%[^,],%[^,]", s1, s2, s3); I get "1" into s1, "" into s2... But what goes into s3 is *not* "3". Of course, I could write my own function, but I would like to know if something is wrong with this. Tnx -- e+ ----> :-) <---- e- e-mail : Les Chercheurs de Bosons Unifies marty@cernvax.cern.ch