Re: a propose for a suppose far better sscanf in assembly



On 26 Jan 2007 14:25:09 -0800, "vid512@xxxxxxxxx" <vid512@xxxxxxxxx>
wrote:
What do you say about my sscanf function?
is it right? 8)
looks good. i haven't had time to test it for some funny cases,
unfortunately. could you provide compiled version which loads all types
possible, and input can be specified by caller? (eg. stdin or
something)? I would love to test it (and find some bugs ;) ), but i am
not in mood to try to compile it.

somethig of this type?

#include <stdio.h>
#include <string.h>

int sscan_m(char** ove, char* input, char* fmt, ...);

int main(void)
{long double kl=0.0;
double k=0.0;
int res;
char ar1[125], fm[64]="%f %L", *pc, *r;

printf(
"Insert array from where take values (double; long double) > ");
r=fgets(ar1, 124, stdin);
if(r==0 || *r==0 || r[strlen(r)-1]!='\n')
return 0;
res=sscan_m(&pc, ar1, fm, &k, &kl);
printf(
"valori double=%f longdouble=%Lf convertiti=%i stringa=%s\n",
k, kl, res, pc);

return 0;
}

.



Relevant Pages