{"id":7617,"date":"2007-08-13T19:43:00","date_gmt":"2007-08-13T19:43:00","guid":{"rendered":"http:\/\/melotopia.net\/b\/?p=7617"},"modified":"2007-08-13T19:43:00","modified_gmt":"2007-08-13T19:43:00","slug":"%ec%98%a4%eb%8a%98%ec%9d%98-%ec%9d%bc%ea%b8%b0-g_strsplit","status":"publish","type":"post","link":"http:\/\/melotopia.net\/b\/?p=7617","title":{"rendered":"\uc624\ub298\uc758 \uc77c\uae30 : g_strsplit"},"content":{"rendered":"<div class=\"desc\">\n        \uc624\ub298\uc740 g_strsplit\uc758 \uc0ac\uc6a9\ubc95\uc744 \ubc30\uc6cc\uc57c\ub9cc \ud588\ub2e4.<br \/>\n        <br \/>\n        \uc77c\ub2e8 \uc0ac\uc6a9\ubc95\uc740 \ub2e4\uc74c\uacfc \uac19\ub2e4.<br \/>\n        <\/p>\n<pre class=\"PROGRAMLISTING\"><blockquote><a href=\"http:\/\/www.idiap.ch\/%7Eformaz\/doc\/glibdocs\/glib-basic-types.html#GCHAR\">gchar<\/a>**     g_strsplit                      (const <a href=\"http:\/\/www.idiap.ch\/%7Eformaz\/doc\/glibdocs\/glib-basic-types.html#GCHAR\">gchar<\/a> *string,<br\/>                                             const <a href=\"http:\/\/www.idiap.ch\/%7Eformaz\/doc\/glibdocs\/glib-basic-types.html#GCHAR\">gchar<\/a> *delimiter,<br\/>                                             <a href=\"http:\/\/www.idiap.ch\/%7Eformaz\/doc\/glibdocs\/glib-basic-types.html#GINT\">gint<\/a> max_tokens);<\/blockquote><\/pre>\n<p><a href=\"http:\/\/developer.gnome.org\/doc\/API\/2.0\/glib\/glib-String-Utility-Functions.html#g-strsplit\" target=\"_blank\"><br \/>\n         http:\/\/developer.gnome.org\/doc\/API\/2.0\/glib\/glib-String-Utility-Functions.html#g-strsplit<br \/>\n        <\/a><br \/>\n<br \/>\n        \uc800\uac70 \uc4f0\uae30 \uc804\uc5d0 \uc77c\ub2e8 2\uc911 \ud3ec\uc778\ud130 **string\ub97c \uc120\uc5b8\ud574\uc57c \ud55c\ub2e4.<br \/>\n        <br \/>\n        char **string;<br \/>\n        <br \/>\n        \uc774\ub807\uac8c \ud558\uba74 string\uc774\ub77c\ub294 \uc774\ub984\uc758 \ubb38\uc790\uc5f4 \ubc30\uc5f4\uc744 &#8220;\uc5ec\ub7ec\uac1c&#8221;\uac00\uc9c8 \uc218 \uc788\ub294 2\uc911 \ud3ec\uc778\ud130\uac00 \uc120\uc5b8\ub41c\ub2e4.<br \/>\n        <br \/>\n        char xxxx=&#8221;abc\/123&#8243;;<br \/>\n        <br \/>\n        string=g_strsplit(xxxx,\/,2);<br \/>\n        <br \/>\n        \uc774\ub807\uac8c \ud558\uba74 string\uc774\ub77c\ub294 \uacf3\uc5d0\ub294 2\uac1c\uc758 \uacf5\uac04\uc774 \ud655\ubcf4\ub418\uc5b4 \uac01\uac01 &#8220;abc&#8221;\uc640 &#8220;123&#8221;\uc774\ub77c\ub294 \ubb38\uc790\uc5f4\uc774 \ud558\ub098\uc529 \ub4e4\uc5b4\uac04\ub2e4. \uc989, *(string+0) = &#8220;abc&#8221; \ud558\uace0 *(string+1)=&#8221;123&#8243;\uc774 \uc2e4\ud589\ub41c \uac83\uc774\ub2e4.<br \/>\n        <br \/>\n        \uc989, xxxx\ub77c\ub294 \ubb38\uc790\uc5f4\uc744 \/\ub77c\ub294 \uae00\uc790\ub97c \uae30\uc900\uc73c\ub85c 2\uac1c\ub85c \uc790\ub974\ub77c\ub294 \ub73b\uc774\ub2e4. \ubb3c\ub860 \uc55e\uc5d0\uc11c\ubd80\ud130 \uc790\ub974\ubbc0\ub85c, \ub4a4\uc5d0 \/\uac00 \uc5ec\ub7ec\uac1c \uc788\uc73c\uba74 \uc788\uc5b4\ub3c4 \ubb34\uc2dc\ub41c\ub2e4. 2\ub300\uc2e0\uc5d0 \ub354 \ud070 \uc22b\uc790\ub97c \ub123\uc73c\uba74 \ub354 \uc5ec\ub7ec\uac1c\ub85c \uc798\ub77c\uc9c4\ub2e4. \ub9cc\uc57d max_tokens\ub97c -1\uc744 \ub123\uac8c \ub418\uba74 \/\uac00 \ub098\uc624\ub294\ub370\ub9c8\ub2e4 \ub2e4 \uc798\ub77c\uc900\ub2e4.<br \/>\n        <br \/>\n        \ubb3c\ub860 \uad6c\ubd84\uc790\ub294 \/\ub9d0\uace0 \uc544\ubb34\uac70\ub098 \uc368\ub3c4 \ub41c\ub2e4. 1\uc774\ub4e0 g\ub4e0 ^\uc774\ub4e0.<br \/>\n        <br \/>\n        \ub2e4\ud589\uc778\uc9c0 \ubd88\ud589\uc778\uc9c0, \uc120\uc5b8\ub9cc \ud574\ub193\uace0 memory allocation\uc740 \uc548\ud574\ub3c4 \ub41c\ub2e4. \uc54c\uc544\uc11c \ud574\uc900\ub2e4.<\/p>\n<p>        \uadf8\ub9ac\uace0 \ub354\ubd88\uc5b4\uc11c \uc55e\uc5d0 g_\uac00 \ub9d0\ud574\uc8fc\ub4ef\uc774 \uc800\uac83\uc740 glib2.0\uc5d0\uc11c \uc81c\uacf5\ud558\ub294 \ud568\uc218\uc774\ub2e4. glib \uc124\uce58\ub294 \uc54c\uc544\uc11c \ud558\uc2dc\uace0, \ucef4\ud30c\uc77c \uc635\uc158\uc5d0<br \/>\n        <span style=\"color: rgb(255, 0, 0);\"><br \/>\n         `pkg-config &#8211;cflags glib-2.0` `pkg-config &#8211;libs glib-2.0`<br \/>\n        <\/span><br \/>\n        \ub97c \ub123\uc5b4\uc918\uc57c \ud55c\ub2e4. \uc5ed\ub530\uc634\ud45c` \ud3ec\ud568\uc774\ub77c\ub294 \uc0ac\uc2e4\uc5d0 \uc8fc\uc758!<\/p>\n<p>        \ub9cc\uc57d \uad6c\ubd84\uc790\ub97c \uc5ec\ub7ec\uac1c \uc4f0\uace0 \uc2f6\uc73c\uba74 g_strsplit_set\uc744 \uc4f0\uba74 \ub41c\ub2e4. \uc774\uac74 delimeter\uc790\ub9ac\uc5d0 \uc5ec\ub7ec\uac1c\uc758 \ubb38\uc790\ub97c \ub123\uc5b4\ub3c4 \ub418\ub294\ub370, \uadf8 \uc5ec\ub7ec\uac1c \uc911 \uc544\ubb34\uac70\ub098 \ud558\ub098 \uc788\uc73c\uba74 \uac70\uae30\uc11c \uc798\ub77c\uc900\ub2e4. \ub098\uba38\uc9c0\ub294 \ub611\uac19\ub2e4. \uc608\ub97c\ub4e4\uc5b4 !@#\ub97c \ub123\uc73c\uba74 !\ub098 @\ub098 #\uac00 \ub098\uc624\uae30\ub9cc \ud558\uba74 \uc798\ub77c\uc900\ub2e4\ub294 \ub73b.<br \/>\n        <\/p>\n<div style=\"width:100%;margin-top:30px;clear:both;height:30px\">\n<div style=\"width:31px;float:left;\">\n<a href=\"\/toolbar\/popup\/abuseReport\/?entryId=405\" onclick=\"window.open(this.href, 'tistoryThisBlogPopup', 'width=550, height=510, toolbar=no, menubar=no, status=no, scrollbars=no'); return false;\"><br \/>\n<img data-recalc-dims=\"1\" decoding=\"async\" alt=\"\uc2e0\uace0\" src=\"https:\/\/i0.wp.com\/t1.daumcdn.net\/tistory_admin\/static\/ico\/ico_spam_report.png\" style=\"border:0\"\/><br \/>\n<\/a>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\uc624\ub298\uc740 g_strsplit\uc758 \uc0ac\uc6a9\ubc95\uc744 \ubc30\uc6cc\uc57c\ub9cc \ud588\ub2e4. \uc77c\ub2e8 \uc0ac\uc6a9\ubc95\uc740 \ub2e4\uc74c\uacfc \uac19\ub2e4. gchar** g_strsplit (const gchar *string, const gchar *delimiter, gint max_tokens); http:\/\/developer.gnome.org\/doc\/API\/2.0\/glib\/glib-String-Utility-Functions.html#g-strsplit \uc800\uac70 \uc4f0\uae30 \uc804\uc5d0 \uc77c\ub2e8 2\uc911 \ud3ec\uc778\ud130 **string\ub97c \uc120\uc5b8\ud574\uc57c \ud55c\ub2e4. char **string; \uc774\ub807\uac8c \ud558\uba74 string\uc774\ub77c\ub294 \uc774\ub984\uc758 \ubb38\uc790\uc5f4 \ubc30\uc5f4\uc744 &#8220;\uc5ec\ub7ec\uac1c&#8221;\uac00\uc9c8 \uc218 \uc788\ub294 2\uc911 \ud3ec\uc778\ud130\uac00 \uc120\uc5b8\ub41c\ub2e4. char xxxx=&#8221;abc\/123&#8243;; string=g_strsplit(xxxx,\/,2); \uc774\ub807\uac8c \ud558\uba74 string\uc774\ub77c\ub294 \uacf3\uc5d0\ub294 2\uac1c\uc758 \uacf5\uac04\uc774 \ud655\ubcf4\ub418\uc5b4 \uac01\uac01 &#8220;abc&#8221;\uc640 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[12],"tags":[],"class_list":["post-7617","post","type-post","status-publish","format-standard","hentry","category-12"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8o6gA-1YR","jetpack-related-posts":[],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=\/wp\/v2\/posts\/7617","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7617"}],"version-history":[{"count":0,"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=\/wp\/v2\/posts\/7617\/revisions"}],"wp:attachment":[{"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7617"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7617"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7617"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}