51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 2179|回复: 1
打印 上一主题 下一主题

[求助] 新学者关于LOADRUNNER的问题,希望得到解答!谢谢!!

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2008-8-11 19:00:23 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
要求
1.编写一个函数
2.函数包含1个参数,类型为字符串
3.函数功能为统计字符串中特定字符串的出现次数,并将相应内容打印,要求是输入字符串中<name> 与</name>中间出现的字符串。
vuser_init  
{
        void search(char *c,int len)
    int i;int pos;
    char beg[100],end[100],name[100];
    if(len<14)
        return;
    for(i=0;i<6;i++)
        beg=c;
    beg = '\0';
    for(i=6;;i++)
    {
        if(c=='<')
            break;
        name[i-6]=c;
    }
    name[i-6] = '\0';
    pos=i;    //结尾开始的位置
    for(;i<len;i++)
        end[i-pos]=c;
    end[i-pos] = '\0';
    if(strcmp(beg,"<name>")==0&&strcmp(end,"</name>")==0)
        cout<<name<<end;

        return 0;
}
在loadrunner下运行,下面的检查出来的错误:
vuser_init.c (4): syntax error; found `int' expecting `;'
vuser_init.c (6): undeclared identifier `len'
vuser_init.c (9): undeclared identifier `c'
vuser_init.c (9): type error: pointer expected
vuser_init.c (13): type error: pointer expected
vuser_init.c (15): type error: pointer expected
vuser_init.c (20): type error: pointer expected
vuser_init.c (23): undeclared identifier `cout'
vuser_init.c (23): operands of << have illegal types `int' and `pointer to char'
vuser_init.c (23): operands of << have illegal types `int' and `pointer to char'
c:\\documents and settings\\zhang dayu\\local settings\\temp\\noname1\\\\combined_noname1.c (5): 10 errors, not writing pre_cci.ci
以前学的不好,现在是赶鸭子上架,关于loadrunner的也不很清楚,什么错误也不知道。现在很急,希望高手给详细说下吧。谢谢!!
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
发表于 2008-8-11 20:21:30 | 只看该作者
变量丢最开始定义,函数的定义方法不对

直接丢到user_init外面去写c的语法就可以了
回复 支持 反对

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-9-20 10:57 , Processed in 0.087558 second(s), 28 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表