由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - about strtok()
相关主题
[转载] UNIX下的strtok[转载] C 语言输入函数紧急求助!
Installation of cxterm on SGIwhat is the differnece between const char * and..
GCC 和 G++ 的区别在什么地方?[转载] 紧急求教一个技术问题 unix c
how to print the first paragraph of a text file?请回答一下9176
Need urgent help on a samll shell script problem!True 64移植档AIX5L 的问题
how to find a file in unixRegular expression
how to count string times using perl急: another批量替换
Re: How to compare two binary files in Unix?奇怪的 C 问题
相关话题的讨论汇总
话题: char话题: str话题: include话题: strtok话题: line
进入Unix版参与讨论
1 (共1页)
b*****i
发帖数: 58
1
I tried some times to solve your problem. At the first time, I got segmental
fault, but at last I am lucky to find a way to parse the tokens.Below is an
example:
#include
#include
#include
void main()
{
char *str;
char *line="15:wildwood.eecs.umich.edu:018032:24.79";
char *delimiter=":";
char *tokenp;
int numtokens,i;
if ((str=calloc(strlen(line) + 1, sizeof(char))) == NULL)
exit(1);
else {
strcpy(str, line);
1 (共1页)
进入Unix版参与讨论
相关主题
奇怪的 C 问题Need urgent help on a samll shell script problem!
a "chdir" problem in C programhow to find a file in unix
[转载] 问个小问题how to count string times using perl
Unix下好好的到了linux下segment faultRe: How to compare two binary files in Unix?
[转载] UNIX下的strtok[转载] C 语言输入函数紧急求助!
Installation of cxterm on SGIwhat is the differnece between const char * and..
GCC 和 G++ 的区别在什么地方?[转载] 紧急求教一个技术问题 unix c
how to print the first paragraph of a text file?请回答一下9176
相关话题的讨论汇总
话题: char话题: str话题: include话题: strtok话题: line