hello.

   char *str;
  the string Is a array the chars
   n1=str[0];
   n2=str[1];
   n3=str[2];
   n4=str[3]; ....


From: "David A. Desrosiers" <[EMAIL PROTECTED]>
Reply-To: "Palm Developer Forum" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Subject: Re: please help! Split String in c
Date: Sun, 15 Feb 2004 09:45:01 -0500 (EST)


> hi, i m new in language c. how do i write a function that can split a > string into 4 character? example: a input string as "abcd" and output as > n1="a",n2="b",n3="c",n4="d" thanks

man 3 strtok. It does what you want.

If the number of fields is fixed, use sscanf.

..or roll your own "stringsep" function.

d.

--
For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/

_________________________________________________________________
�Est�s pensando en cambiar de coche? Todas los modelos de serie y extras en MSN Motor. http://motor.msn.es/researchcentre/



-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/

Reply via email to