ÃÑ ÆäÀÌÁö ¼ö : 3224
![]()
|
Facebook Joinc ±×·ì
Joinc QA »çÀÌÆ®
![]()
Tweet
joinc´Â Firefox¿Í chrome¿¡¼ Å×½ºÆ® Çß½À´Ï´Ù. IE¿¡¼´Â Å×À̺íÀÌ ±úÁö°Å³ª À̹ÌÁö°¡ º¸ÀÌÁö ¾ÊÀ» ¼ö ÀÖ½À´Ï´Ù. ƯÈ÷ ±¸±Û DocsÀ̹ÌÁöÀÇ °æ¿ì ¿¢¹Úó¸®µÉ ¼ö ÀÖ½À´Ï´Ù. ¼³¸í
»êÇÏ´ÔÀÇ ÅäÅ«ÃßÃâÇϱ⸦ Á¶°¢ÄÚµå ¸ðÀ½À¸·Î ¿Å°å½À´Ï´Ù.
strsepÀ̳ª strtok °°Àº ÅäÅ« ÃßÃâ ÇÔ¼ö¸¦ ¸¸µé¾îº»´Ù. ±âÁ¸ÀÇ Ç¥ÁØÇÔ¼öµéÀº ¸Þ¸ð¸®¸¦ ÇÒ´çÇÏ¸ç Æ÷ÀÎÅ͸¦ ¹ÝȯÇϴµ¥ À̰ÍÀÌ ¾ðÁ¦ ÇØÁ¦µÇ´ÂÁö ¾Ë ¼ö ¾ø´Ù. (¹°·Ð, glibc¼Ò½º¸¦ º¸¸éµÈ´Ù.) ¼Ò½º´Â º¸Áö ¾Ê¾ÒÁö¸¸ ´ë·«, »ç¿ëÀÚ°¡ Á÷Á¢ ÇØÁ¦ÇØ¾ß ÇÒ °Í °°¾Æ º¸ÀδÙ. ¶ÇÇÑ, µÑ´Ù manÀ» º¸¸é ÁÖÀǰ¡ º¸ÀδÙ. ±×·¡¼, ¿ëµµ¿¡ ¸Â°í ´õ ÁÁÀº(³»°¡ º¸±â¿¡) ÇÔ¼ö¸¦ ¸¸µé¾î »ç¿ëÇÑ´Ù.
strsepÀÇ NOTES :
The strsep() function was introduced as a replacement for strtok(), since the latter cannot
strtokÀÇ BUGS :handle empty fields. However, strtok() conforms to ANSI-C and hence is more portable.
Never use these functions. If you do, note that:
These functions modify their first argument. These functions cannot be used on constant strings. The identity of the delimiting character is lost. The strtok() function uses a static buffer while parsing, so it's not thread safe. Use strtok_r() if this matters to you. »ç¿ë¹æ¹ýchar *token(char *str, char *src, const char* sep);
#include "token.h" int main() { char src[20]; char str[20]; char* next = &src[0]; strcpy(src, "ab1de12eoqd12dq"); while(next = token(str, next, "12")) { printf("%s\n", str); } return(0); } ÄÚµå |
|
|
EmailÀ» ±âÀÔÇϸé, ´ñ±ÛÀÌ ¸ÞÀÏ·Î Àü´ÞµË´Ï´Ù. |
|