int spitstring(const char *str, char c, char buf[10][30], int *count)//14 行
{
if (str == NULL || buf == NULL || count == NULL)
return -1;
const char *start = str;//18行
char *p = NULL;
int i = 0;
do
{
p = strchr(start, c);
if (p != NULL)
{
int len = p - start;
if (len > 0)
{
底下不写了
}}while (*start);//41行
底下不写了
int main(void)
{
const char *p = "abcdef,acccd,eeee,aaaa,e3eeee,ssss,";
char buf[10][30] = { 0 };
int n = 0;
int ret = 0;
int i = 0;
ret = spitstring(p, ',', buf, &n);
错误 1 error C2143: 语法错误 : 缺少“;”(在“const”的前面) 18行
错误 16 error C2100: 非法的间接寻址 41行
把const char *换成const char *或者char *错误都消失
这种错误只在vs中存在,linux中编译无此错误
求指教