can some exaplin me wat WHAT and HOW this sacanf function is working
sscanf(NAME(img), "%[^_]_%[^_]_%[^_]_%[^_]_%d.%[^_]",
userid, head, expression, eyes, &scale, photo);
its used here
Code:
load_target(img, net)
IMAGE *img;
BPNN *net;
{
int scale;
char userid[40], head[40], expression[40], eyes[40], photo[40];
userid[0] = head[0] = expression[0] = eyes[0] = photo[0] = '\0';
/*** scan in the image features ***/
sscanf(NAME(img), "%[^_]_%[^_]_%[^_]_%[^_]_%d.%[^_]",
userid, head, expression, eyes, &scale, photo);
if (!strcmp(userid, "glickman")) {
net->target[1] = TARGET_HIGH; /* it's me, set target to HIGH */
} else {
net->target[1] = TARGET_LOW; /* not me, set it to LOW */
}
}
Code:
#define NAME(img) ((img)->name)
i understand the functioning of scanf like in this
Code:
sscanf(line, "%d %d", &nc, &nr);
BUT i am not able to understand what wil this refer to %[^_]_ and what wil it store in userid and ither mentioned as in
sscanf(NAME(img), "%[^_]_%[^_]_%[^_]_%[^_]_%d.%[^_]",
userid, head, expression, eyes, &scale, photo);
Thankyou

