[Dev-C++] searching characters in a string newbie
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <Rub...@al...> - 2005-01-10 15:56:50
|
Here is the code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc,char *argv[])
{
char *x,*y;
=20
if(argc=3D=3D1){
printf("Uso : 2token STRING\n");
return -1;
}
if((x=3D(char *)malloc(1000)) =3D=3D NULL)
return -1;
strcpy(x,argv[1]);
=20
if((y=3Dstrtok(x,"|")) !=3D NULL)
if((y=3Dstrtok(NULL,"|")) !=3D NULL)
printf("\n%s\n",y);
system("pause");
return 0;
}
Ruben Savia
Ingeniero Electr=F3nico
Datacom Services
eBD - eBusiness Division
Alcatel de Argentina S.A.
e-mail : rub...@al...=20
Phone: 5411 4349 - 1111 ext.1001
Fax: 5411 4349 - 1199
Alcanet : 2930-1001
Web site: www.ind.alcatel.com=20
|