51Testing软件测试论坛

标题: c vuser脚本中,如何使用c语言的库函数? [打印本页]

作者: hlw1013    时间: 2008-6-20 17:14
标题: c vuser脚本中,如何使用c语言的库函数?
包含这样的语句
#include<stdio.h>
运行时提示:stdio:no such file or directory
作者: achang21    时间: 2008-6-22 22:03
我也有这样的困惑!希望有人来解决!
作者: aks5201314    时间: 2008-6-23 10:00
Loadrunner中的库函数(头文件)都存放在安装目录下的include目录下,你需要引用那个库函数文件,可以先到include目录下看一下.确认引用的库函数文件存在再引用.还有引用库函数的写法最好与LR保持一致.
作者: wxq8102    时间: 2009-7-9 11:23
原来写法:
#include<stdio.h>

my_function()
{
/* Text generating code */
printf(“$$$$$$$$$$$\n”);
printf(“Hello World!\n”);
printf(“$$$$$$$$$$$\n\n”);
}


main()
{
my_function(); /* call 1 */

printf(“This program demonstrates user-defined functions.\n\n”);

my_function(); /* call 2 */
}

变化后的写法:
my_function( )
       {
            lr_output_message("%%%%\n");
            lr_output_message("abc\n");
            lr_output_message("&&&&\n\n");
        }
Action()
  {
    my_function( ); /* call 1 */
    lr_output_message("abc\n");
   //  my_function(); /* call 2 */
   return 0;
}
执行后的结果:
Action.c(3): %%
Action.c(4): abc
Action.c(5): &&&&

Action.c(14): abc
变化一下函数就行了,一样的

[ 本帖最后由 wxq8102 于 2009-7-9 11:28 编辑 ]
作者: canicanliu    时间: 2013-1-17 11:00
为什么我用C语言的库函数sin()这些返回的结果会是错误的呢?




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2