vsprintf是干什么用的?
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
char *newfmt(const char *fmt, ...)
{
char *p;
char *tmp;
va_list ap;
if((p = malloc(128)) == NULL)
{
return (NULL);
}
va_start(ap,fmt);
(void)vsprintf(p, "%s" ,ap);
va_end(ap);
return p;
}
int main()
{
printf("%s\n", newfmt("a","b","c"));
return 0;
}
怎么打印出来的是 b
而不是 abc?
不明白的问,mfc里讲的也好象不是很仔细的了