mirror of
https://github.com/adtools/clib2.git
synced 2025-12-08 14:59:05 +00:00
- Added the strtok_test program.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14759 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
35
test_programs/strtok_test.c
Normal file
35
test_programs/strtok_test.c
Normal file
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* $Id: strtok_test.c,v 1.1 2004-10-25 19:50:33 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*/
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
int
|
||||
main(int argc,char ** argv)
|
||||
{
|
||||
char test[256];
|
||||
char * one;
|
||||
char * two;
|
||||
char * three;
|
||||
|
||||
strcpy(test," one two three");
|
||||
|
||||
strtok(test," ");
|
||||
|
||||
one = strtok(NULL," ");
|
||||
two = strtok(NULL," ");
|
||||
three = strtok(NULL," ");
|
||||
|
||||
printf("one = %p '%s'\n",one,one);
|
||||
printf("two = %p '%s'\n",two,two);
|
||||
printf("three = %p '%s'\n",three,three);
|
||||
|
||||
return(0);
|
||||
}
|
||||
Reference in New Issue
Block a user