printf("\r\n----------------------------------\r\n");
/* Determine how much space we need. */
for (s = str; s != NULL; s = va_arg (ap, const char *))
{
char * a;
memcpy(&a, ap, 4);
printf("%u %u \r\n", (int)*((int*)ap), (int)*((int*)&a));//以下个打印为了让你看清楚地址关系
printf("%u %u \r\n", (int)*((int*)ap), a);
这是man va_arg里面的原话:
If there is no next argument, or if type is not compatible
with the type of the actual next argument (as promoted
according to the default argument promotions), random
errors will occur.