char * a ="abc";
const char* buffer2 = "abc";
printf("Http Test, dump data: ");
CCLog("%s", *buffer2);
平台是vc2010,这样写,调试时就会报错,系统提示msvcr100d.dll中出现访问冲突,冲突的大致位置在vc自带的源码文件output.c中的这个位置
#else /* _UNICODE */
if (flags & (FL_LONG|FL_WIDECHAR)) {
if (text.wz == NULL) /* NULL passed, use special string */
text.wz = __wnullstring;
bufferiswide = 1;
pwch = text.wz;
while ( i-- && *pwch )
++pwch;
textlen = (int)(pwch - text.wz);
/* textlen now contains length in wide chars */
} else {
if (text.sz == NULL) /* NULL passed, use special string */
text.sz = __nullstring;
p = text.sz;
while (i-- && *p)
++p;
textlen = (int)(p - text.sz); /* length of the string */
}
但是这样写又是正常的
CCLog("%s", “abc”);
这是为啥呢,难道cclog不能接受字符变量?