Re: strchr problem
see teh code in main....
#include <stdio.h>
int main(void)
{
char buffer[]="$GPSACP: 140754.999,0714.0826S,11244.0902E,1.6,30.2,3,351.22,0.25,0.13,010707,05";
char *u,*w;
int pos,i=0,*vec=NULL,k=0;
w=buffer;
while(k<strlen(buffer))
{
u=strchr(w,',');
if(u!=NULL)
{
vec=(int *)realloc(vec,i+1);
vec[i++]=u-buffer;
w=u+1;
}
k++;
}
for(pos=0;pos<i;pos++)
printf("\n%d\n",vec[pos]);
}
the program print comma location (int) ....(position start in zero)
enjoy