MSC 5.X scanf question

Jon Brinkmann jvb7u at astsun1.astro.Virginia.EDU
Thu Jul 20 08:23:02 AEST 1989


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.

Can 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 at Virginia.EDU
Astronomy Department 		ARPA/Internet:	jvb7u at astsun1.astro.Virginia.EDU
University of Virginia		UUCP:		...!uunet!virginia!jvb7u
P.O. Box 3818			SPAN/HEPnet:	6654::jvb7u
Charlottesvile, VA  22903-0818
================================================================================



More information about the Comp.lang.c mailing list