[comp.lang.c] MSC 5.X sscanf question

jvb7u@astsun1.astro.Virginia.EDU (Jon Brinkmann) (07/15/89)

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 <stdio.h>

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
================================================================================