i am a beginner in C programming, and i appreciate any help with strtok. what i wanna do is for the program to scan the data, and whenever it encounters the alphabet "l", the section before the alphabet "l" would be copied to a string array. for instance,
Code:
#include <stdio.h>
#include <string.h>
main ()
{
char *b;
int i,;
char s[100];
char data[100];
strcopy(data,"asdldsaldsal");
for(i=0;i<=2;i++)
{
b = strtok (data,'l');
s[i]=b;
if (s[i]==NULL)
break;
}
printf("s[1]=",s[1]);
return 0;
}
why doesnt it run? thank you for your attention...
sincerely
gwmexod