socket 协议中的分割函数
来源:互联网 发布:linux保存文件命令 编辑:程序博客网 时间:2024/04/28 21:47
splitchartoparamarr(char *x,char *y,char *paramarrname)//该函数的作用是将输入的字符串x,通过y符号分割,保存到paramarrname参数数组中
{
extern char * strtok(char * string, const char * delimiters );
char charstring[1000],separators[100],paramname[110];//定义输入字符串,字符串长度为1000,分隔符长度为100,参数元素名长度110
char * token;
int i=0;//初始化计数器
char paramcount[10],paramarrcount[110];//定义生成参数数组的编号及参数名
strcpy(charstring,x);
strcpy(separators,y);
token = (char *)strtok(charstring, separators);// Get the first token
if (!token) {
lr_output_message ("No tokens found in string!");
return( -1 );
}
while (token != NULL )// While valid tokens are returned
{
// lr_output_message ("%s", token );//输入分割值
i++;
sprintf(paramname,"%s_%d",paramarrname,i);
// lr_output_message ("%s", paramname );//输出参数名
lr_save_string(token,paramname);
token = (char *)strtok(NULL, separators); // Get the next token
}
sprintf(paramarrcount,"%s_count",paramarrname);
itoa(i,paramcount,10);
lr_save_string(paramcount,paramarrcount);
}
{
extern char * strtok(char * string, const char * delimiters );
char charstring[1000],separators[100],paramname[110];//定义输入字符串,字符串长度为1000,分隔符长度为100,参数元素名长度110
char * token;
int i=0;//初始化计数器
char paramcount[10],paramarrcount[110];//定义生成参数数组的编号及参数名
strcpy(charstring,x);
strcpy(separators,y);
token = (char *)strtok(charstring, separators);// Get the first token
if (!token) {
lr_output_message ("No tokens found in string!");
return( -1 );
}
while (token != NULL )// While valid tokens are returned
{
// lr_output_message ("%s", token );//输入分割值
i++;
sprintf(paramname,"%s_%d",paramarrname,i);
// lr_output_message ("%s", paramname );//输出参数名
lr_save_string(token,paramname);
token = (char *)strtok(NULL, separators); // Get the next token
}
sprintf(paramarrcount,"%s_count",paramarrname);
itoa(i,paramcount,10);
lr_save_string(paramcount,paramarrcount);
}
- socket 协议中的分割函数
- loadrunner中socket协议中的关联函数
- Java中的字符串分割函数
- java中的字符串分割函数
- java中的字符串分割函数
- java中的字符串分割函数
- socket中的bind函数
- PHP中的socket函数
- PHP中的socket函数
- 学习笔记,php中的分割函数
- C中的一个字符串分割函数
- 分割函数,可等同于java中的split
- C语言中的字符串分割函数
- java中的字符串分割函数 split
- oracle中的split 字符串分割函数
- java中的字符串分割split函数
- 【转】 java中的字符串分割函数
- Oracle中的split字符串分割函数
- sys.all_sql_modules 视图, 它里面存储了函数,表,存储过程,视图等的定义语句
- bash编程中不得不注意的一些细节
- 代码注释规范(3)
- libpng 同 zlib配置使用
- iOS开发中常用代码
- socket 协议中的分割函数
- 挥之不去的ubuntu11.04
- /dev/null 和/dev/zero 设备文件说明 (
- flex 时间类型转换
- 软件测试经验分享博客 MyTestLife.com
- Android database tutorial
- Document 对象详解
- Linux 下用户空间与内核空间数据交换的方式
- C#文件读写补充知识