Z
zhangsonglovexiaoniuniu
Hi all,
i got a program as follows:
void str2mac(void)
{
unsigned char xx[6];
char str[20] = "11:22:33:44:55:66";
/* load str to xx */
1. sscanf(str,"%x:%x:%x:%x:%x:
%x",&xx[0],&xx[1],&xx[2],&xx[3],&xx[4],&xx[5]);
2. sscanf(str,"%c:%c:%c:%c:%c:
%c",&xx[0],&xx[1],&xx[2],&xx[3],&xx[4],&xx[5]);
}
is there some difference between 1 and 2?
thanks.
Evan
i got a program as follows:
void str2mac(void)
{
unsigned char xx[6];
char str[20] = "11:22:33:44:55:66";
/* load str to xx */
1. sscanf(str,"%x:%x:%x:%x:%x:
%x",&xx[0],&xx[1],&xx[2],&xx[3],&xx[4],&xx[5]);
2. sscanf(str,"%c:%c:%c:%c:%c:
%c",&xx[0],&xx[1],&xx[2],&xx[3],&xx[4],&xx[5]);
}
is there some difference between 1 and 2?
thanks.
Evan