整形的用字符串输出就会有如下错误:
Action.c(36): Error: C interpreter run time error: Action.c (36):
Error -- memory violation : Exception ACCESS_VIOLATION received.
我随便弄了个脚本如下:
Action()
{
int j;
web_reg_save_param("param1",
"LB=Content-Length: ",
"RB=\r\n""",
"NotFound=ERROR",
"Ord=all",
"Search=Headers",
LAST);
web_url("www.hao123.com",
"URL=http://www.hao123.com/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t2.inf",
"Mode=HTML",
LAST);
j=atoi(lr_eval_string("{param1_count}"));
lr_output_message("the j is %s",j);
lr_output_message(lr_eval_string("{param1_j}"));
return 0;
}
看这一句:lr_output_message("the j is %s",j);
我原来是用整形%d输出一个字符的变量的,后来就变成了随机数。
后来我转为整形后再用%s输出就成了:memory violation 。
我是想直接得到一个数组的长度,我不明白的是LR中数组的长度怎么会是字符串的变量呢??