Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!ames!haven!uvaarpa!hudson!astsun1.astro.Virginia.EDU!jvb7u From: jvb7u@astsun1.astro.Virginia.EDU (Jon Brinkmann) Newsgroups: comp.lang.c Subject: MSC 5.X sscanf question Message-ID: <1740@hudson.acc.virginia.edu> Date: 14 Jul 89 23:24:10 GMT Sender: news@hudson.acc.virginia.edu Reply-To: jvb7u@astsun1.astro.Virginia.EDU (Jon Brinkmann) Organization: University of Virginia, Charlottesville Lines: 48 I am trying to write a front end to the MicroSoft 5.X sscanf function to allow users to use a default value. The problem I am having is that I can't pass the parameters from the called function to sscanf. Does anyone help here? Perhaps I need a 'vsscanf' function? Example: #include main () { double u = 1.0, v = -1.0; Myscanf ("Enter u", "%lf", &v); Myscanf ("Enter u, v", "%lf %lf", &u, &v); } Myscanf (const char *p, const char *f, ...) { char b [80]; printf ("%s: ", p); gets (&b); if (strlen (b) != 0) sscanf (f, ????); } Jon -------------------------------------------------------------------------------- Bradley's Bromide: If computers get too powerful, we can organize them into a committee -- that will do them in. ================================================================================ __ / / ) / / _ __ /--< __ o ____ /_ ______ __. ____ ____ (__/ (_)_/ <_ /___/ / (_<_/ / <_/\_/ / / <_(_/|_/ / <_/ / <_ ================================================================================ Jon Brinkmann BITnet: jvb7u@Virginia.EDU Astronomy Department ARPA/Internet: jvb7u@astsun1.astro.Virginia.EDU University of Virginia UUCP: ...!uunet!virginia!jvb7u P.O. Box 3818 SPAN/HEPnet: 6654::jvb7u Charlottesvile, VA 22903-0818 ================================================================================