求助,Loadrunner中strcpy函数出错
我输入下面的代码:Action{
char *p="how are you ?";
char name;
name="ABCDEFGHIJKLMNOPQRS";
strcpy(name,p); //name改变为"how are you ? "
lr_output_message("%s",name);
return 0;
}
可是报了下面的错误:
Action.c (91): illegal character `\0241'
Action.c (91): illegal character `\0241'
Action.c (93): operands of = have illegal types `array 30 of char' and `pointer to char'
Action.c (93): lvalue required
Action.c (93): illegal character `\0241'
Action.c (93): illegal character `\0241'
d:\\lounrunner wenjian\\cs_006\\\\combined_cs_006.c (5): 6 errors, not writing pre_cci.ci
求帮助!!! 不要用指针型,用数组型字符串 Action()
{
char p="how are you ?";
char name="ABCDEFGHIJKLMNOPQRS";
//name="ABCDEFGHIJKLMNOPQRS";
strcpy(name,p);
lr_output_message("%s",name);
}
这样写试试 Action()
{
char *p="how are you ?";
char name="ABCDEFGHIJKLMNOPQRS";
//name="ABCDEFGHIJKLMNOPQRS";
strcpy(name,p);
lr_output_message("%s",name);
}
或者这样 嗯,好的,谢谢各位的指导!
页:
[1]