51Testing软件测试论坛

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

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

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

[原创] itoa 错误

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2007-9-21 17:16:11 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
问个问题,为什么我用itoa将INT转为字符串但为什么LR总报错,谁能帮我看下。
我知道可以用%d将HttpRetCode打出来,但为什么我转换再打就出问题呢



#include "web_api.h"


Action()


{
        int HttpRetCode;

        int ret;

        char * str1;

        web_reg_find("Text/IC=gooGle","SaveCount=go_count","ID=easy to search",        LAST);

        web_add_cookie("PREF=ID=f87cd5a5457805f7:NW=1:TM=1190189009:LM=1190189009:S=OcTE4JtxbiR89iHx; DOMAIN=www.google.com");

        ret=web_url("www.google.com",
                "URL=https://www.google.com/",
                "TargetFrame=",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=",
                "Snapshot=t1.inf",
                "Mode=HTML",
                EXTRARES,
                "URL=http://www.google.com/images/nav_logo3.png", "Referer=http://www.google.com/", ENDITEM,
                LAST);

        if(ret==LR_FAIL)

        lr_abort();
               
        if (atoi(lr_eval_string("{go_count}"))>0)

        {lr_output_message("find the page");}

        else

        {lr_error_message("not find the page");}

        HttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE);

        itoa(HttpRetCode,str1,10);

        lr_log_message("page loaded , and the http code is %s" , HttpRetCode);

        else

        lr_log_message("page loaded failed");

return 0;

}
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
发表于 2007-9-22 10:43:41 | 只看该作者
把STR1换成数组变量看一下。
回复 支持 反对

使用道具 举报

本版积分规则

关闭

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

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

GMT+8, 2024-6-17 08:18 , Processed in 0.076620 second(s), 27 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

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