{"id":142,"date":"2014-06-03T19:41:02","date_gmt":"2014-06-03T10:41:02","guid":{"rendered":"http:\/\/csharp.ihavenomoney.co.kr\/?p=142"},"modified":"2019-06-27T10:41:51","modified_gmt":"2019-06-27T01:41:51","slug":"%eb%b3%b5%ec%82%ac%ec%83%9d%ec%84%9c%ec%9e%90%ec%9d%98-%ed%95%84%ec%9a%94%ec%84%b1-%ec%83%98%ed%94%8c","status":"publish","type":"post","link":"https:\/\/csharp.ihavenomoney.co.kr\/?p=142","title":{"rendered":"\ubcf5\uc0ac\uc0dd\uc131\uc790\uc758 \ud544\uc694\uc131 \uc0d8\ud50c"},"content":{"rendered":"\n<pre class=\"lang:c++ decode:true \" >#include \"stdafx.h\"\r\n#include &lt;string.h&gt;\r\n#include &lt;conio.h&gt;\r\n\r\n#define DEBUG\r\n\r\nclass CStr{\r\n    char* str;\r\npublic:\r\n\tCStr(char *s=\"\"){\r\n\t\tstr = new char[strlen(s)+1];\r\n\t\tstrcpy(str,s);\r\n\t\tprintf(\"construction\\n\");\r\n\t}\r\n\t~CStr() {\r\n\t\tdelete[] str;\r\n\t\tprintf(\"destructor\\n\");\r\n\t}\r\n\tvoid Print(){\r\n\t\tprintf(\"%s\\n\",str);\r\n\t}\r\n};\r\n\r\n\/\/void f(CStr s)\uc624\ub958 \/\/\uc0dd\uc131\uc790\uc5d0\uc11c \ub3d9\uc801\uc73c\ub85c \uba54\ubaa8\ub9ac\ub97c \ud560\ub2f9\ud558\ub294 \r\n\/\/\uac1d\uccb4\ub97c \ud30c\ub77c\uba54\ud130\ub85c \uc804\ub2ec\ud560 \ub54c\ub294 \ud56d\uc0c1 \ud3ec\uc778\ud130 \ud639\uc740 \ub808\ud37c\ub7f0\uc2a4\ub97c \uc804\ub2ec\ud55c\ub2e4.\r\nvoid f(CStr&amp; s)\r\n{\r\n\ts.Print();\r\n}\r\n\r\nvoid main()\r\n{\r\n\tCStr s(\"hello\");\r\n\tf(s);\r\n\r\n#ifdef DEBUG\r\n\t\/\/cmd\r\n\tchar c;\r\n\tscanf(\"%c\",&amp;c);\r\n#endif\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>#include &#8220;stdafx.h&#8221; #include &lt;string.h&gt; #include &lt;conio.h&gt; #define DEBUG class CStr{ char* str; public: CStr(char *s=&#8221;&#8221;){ str = new char[strlen(s)+1]; strcpy(str,s); printf(&#8220;construction\\n&#8221;); } ~CStr() { delete[] str; printf(&#8220;destructor\\n&#8221;); } void Print(){ printf(&#8220;%s\\n&#8221;,str); } }; \/\/void f(CStr s)\uc624\ub958 \/\/\uc0dd\uc131\uc790\uc5d0\uc11c \ub3d9\uc801\uc73c\ub85c \uba54\ubaa8\ub9ac\ub97c \ud560\ub2f9\ud558\ub294 \/\/\uac1d\uccb4\ub97c \ud30c\ub77c\uba54\ud130\ub85c \uc804\ub2ec\ud560 \ub54c\ub294 \ud56d\uc0c1 \ud3ec\uc778\ud130 \ud639\uc740 \ub808\ud37c\ub7f0\uc2a4\ub97c \uc804\ub2ec\ud55c\ub2e4. void f(CStr&amp; s) { s.Print(); }\u2026 <span class=\"read-more\"><a href=\"https:\/\/csharp.ihavenomoney.co.kr\/?p=142\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[],"class_list":["post-142","post","type-post","status-publish","format-standard","hentry","category-c"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/csharp.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/142","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/csharp.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/csharp.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/csharp.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/csharp.ihavenomoney.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=142"}],"version-history":[{"count":2,"href":"https:\/\/csharp.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/142\/revisions"}],"predecessor-version":[{"id":540,"href":"https:\/\/csharp.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/142\/revisions\/540"}],"wp:attachment":[{"href":"https:\/\/csharp.ihavenomoney.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/csharp.ihavenomoney.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=142"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/csharp.ihavenomoney.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}