“名称 类型,名称 类型”
#include <iostream>
#include <cstring>
#include <map>
#include <stdarg.h>
using namespace std;
int main()
{
char *p = " name sting, ring in ";
char *beg = p;
while(*p != '\0')
{
char *end = NULL;
char *toker_end = NULL;
char *toker_beg = NULL;
p++;
if(*p == ',' || *p =='\0')
{
end = p;
toker_end = end;
toker_beg = beg;
end --;
while(*end == ' ')
{
end --;
}
while(*beg == ' ')
{
beg++;
}
while(*beg != ' ' && beg < toker_end)
{
beg++;
}
while(*end != ' ' && end > toker_beg)
{
end --;
}
if(beg > end)
{
cout<<"errpr"<<endl;
system("pause");
return 0;
}
while(beg != end)
{
beg ++;
if( *beg != ' ')
{
cout<<"errpr"<<endl;
system("pause");
return 0;
}
}
beg = toker_end + 1;
}
}
cout<<"right"<<endl;
system("pause");
return 0;
}