{"id":661,"date":"2008-01-18T02:41:17","date_gmt":"2008-01-17T17:41:17","guid":{"rendered":"http:\/\/www.gisdeveloper.co.kr\/?p=661"},"modified":"2017-01-31T19:48:38","modified_gmt":"2017-01-31T10:48:38","slug":"%ea%b0%80%ec%83%81%ed%95%a8%ec%88%98-%ec%9e%ac%ec%a0%95%ec%9d%98","status":"publish","type":"post","link":"http:\/\/www.gisdeveloper.co.kr\/?p=661","title":{"rendered":"\ubc18\ud658\ud0c0\uc785\uc774 \ub2e4\ub974\uac8c \uac00\uc0c1\ud568\uc218 \uc7ac\uc815\uc758\ud560 \uc218 \uc788\ub294\uac00?"},"content":{"rendered":"<p>\ucf54\ub529\uc911 \uad81\uae08\ud558\uc5ec Test \ud574\ubcf8 \ucf54\ub4dc\uc774\ub2e4. \uc21c\uc218\uac00\uc0c1\ud568\uc218\uac00 \uc788\ub2e4\uace0 \ud560\ub54c \uc774\ub97c \uc18d\uc0c1\ubc1b\ub294 \ud074\ub798\uc2a4\uc5d0\uc11c \uc21c\uc218\uac00\uc0c1\ud568\uc218\ub97c \uc7ac\uc815\uc758\ud560\ub54c \ubc18\ud658\ud0c0\uc785\uc744 \ub2e4\ub974\uac8c \ud560 \uc218 \uc788\ub294\uac00\ub77c\ub294 \uc2a4\uc2a4\ub85c\uc758 \uc9c8\ubb38\uc5d0 \ub300\ud55c \uc815\ub9ac\uc774\ub2e4.<\/p>\n<p>\uae30\ubcf8\uc801\uc73c\ub85c Base\uac00 \ub418\ub294 \ud074\ub798\uc2a4 \ub458\uc774 \uc788\ub294\ub370 \uc544\ub798\uc640 \uac19\ub2e4.<\/p>\n<pre>class ReturnType {\r\nprotected:\r\n\tint x;\r\npublic:\r\n\tReturnType(int x) {\r\n\t\tthis-&gt;x = x;\r\n\t}\r\n\r\n\tvirtual int GetValue() {\r\n\t\treturn x;\r\n\t}\r\n};\r\n\r\nclass Base {\r\npublic:\r\n\tvirtual ReturnType* Get(int a, int b) = 0;\r\n};\r\n<\/pre>\n<p>\ud074\ub798\uc2a4 Base\ub294 Get\uc774\ub77c\ub294 \uc21c\uc218\uac00\uc0c1\ud568\uc218\ub97c \uac00\uc9c0\uace0 \uc788\uace0 \ubc18\ud658\uac12\uc73c\ub85c ReturnType\uc744 \uac16\ub294\ub2e4. \uc5ec\uae30\uc11c \ub530\uc838\ubcf4\uace0 \uc2f6\uc740 \uac83\uc740 Base\uc758 Get\uc774\ub77c\ub294 \uc21c\uc218\uac00\uc0c1\ud568\uc218\uc758 \ubc18\ud658 Type\uc744 \ub2e4\ub974\uac8c \ud558\uc5ec \uc120\uc5b8\ud560 \uc218 \uc788\ub0d0\ub294 \uac83\uc774\ub2e4. \ub300\ub2f5\uc740 &#8220;\uc54a\ub41c\ub2e4&#8221;\uc774\uc9c0\ub9cc \ubc18\ud658 Type\ub3c4 OO\uc758 \ub2e4\ud615\uc131\uc744 \ud65c\uc6a9\ud574\uc11c \ub2e4\ub974\uac8c \uc120\uc5b8\ud560 \uc218 \uc788\ub2e4\ub294 \uac83\uc774\ub2e4. \uc544\ub798\ub97c \ubcf4\uc790.<\/p>\n<pre>class ReturnType2 : public ReturnType {\r\npublic:\r\n\tReturnType2(int x) : ReturnType(x) {\r\n\t}\r\n\r\n\tvirtual int GetValue() {\r\n\t\treturn x*x;\r\n\t}\r\n};\r\n\r\nclass Derive1 : public Base {\r\npublic:\r\n\tvirtual ReturnType2* Get(int a, int b) {\r\n\t\tReturnType2* pRT = new ReturnType2(a+b);\r\n\t\treturn pRT;\r\n\t}\r\n};\r\n\r\nclass Derive2 : public Base {\r\npublic:\r\n\tvirtual ReturnType* Get(int a, int b) {\r\n\t\tReturnType* pRT = new ReturnType(a*2+b*2);\r\n\t\treturn pRT;\r\n\t}\r\n};\r\n<\/pre>\n<p>ReturnType\uc73c\ub85c\ubd80\ud130 \uc0c1\uc18d\ubc1b\uc740 ReturnType2 \ud074\ub798\uc2a4\uac00 \uc788\uc73c\uba70 Base\ub85c\ubd80\ud130 \uc0c1\uc18d\ubc1b\uc740 Derive1\uacfc Derive2\uac00 \uc788\ub2e4. \ubd84\uba85\ud55c\uac83\uc740 GetValue\ub77c\ub294 \uc21c\uc218\uac00\uc0c1\ud568\uc218\uc758 \ubc18\ud658\ud0c0\uc785\uc774 \uc0c1\uc18d\ubc1b\uc740 Base\uc640 \ub2e4\ub974\ub2e4\ub294 \uc810\uc774\ub2e4. \ud558\uc9c0\ub9cc \uc644\uc804\uc774 \ub2e4\ub978\uac83\uc740 \uc544\ub2c8\uace0 \ubc18\ud658\ud0c0\uc785\uc774 \uc0c1\uc18d\uad00\uacc4\ub97c \uac16\ub294\ub2e4. \uc774\ub7f0 \uc0c1\uc18d\uad00\uacc4\uac00 \ubc18\ud658\ud0c0\uc785\uc744 \ub2e4\ub974\uac8c \ud560 \uc218 \uc788\ub294 \uc774\uc720\uac00 \ub418\ub294 \uac83\uc774\ub2e4.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\ucf54\ub529\uc911 \uad81\uae08\ud558\uc5ec Test \ud574\ubcf8 \ucf54\ub4dc\uc774\ub2e4. \uc21c\uc218\uac00\uc0c1\ud568\uc218\uac00 \uc788\ub2e4\uace0 \ud560\ub54c \uc774\ub97c \uc18d\uc0c1\ubc1b\ub294 \ud074\ub798\uc2a4\uc5d0\uc11c \uc21c\uc218\uac00\uc0c1\ud568\uc218\ub97c \uc7ac\uc815\uc758\ud560\ub54c \ubc18\ud658\ud0c0\uc785\uc744 \ub2e4\ub974\uac8c \ud560 \uc218 \uc788\ub294\uac00\ub77c\ub294 \uc2a4\uc2a4\ub85c\uc758 \uc9c8\ubb38\uc5d0 \ub300\ud55c \uc815\ub9ac\uc774\ub2e4. \uae30\ubcf8\uc801\uc73c\ub85c Base\uac00 \ub418\ub294 \ud074\ub798\uc2a4 \ub458\uc774 \uc788\ub294\ub370 \uc544\ub798\uc640 \uac19\ub2e4. class ReturnType { protected: int x; public: ReturnType(int x) { this-&gt;x = x; } virtual int GetValue() { return x; } }; class Base { &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.gisdeveloper.co.kr\/?p=661\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;\ubc18\ud658\ud0c0\uc785\uc774 \ub2e4\ub974\uac8c \uac00\uc0c1\ud568\uc218 \uc7ac\uc815\uc758\ud560 \uc218 \uc788\ub294\uac00?&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[117,8],"tags":[],"class_list":["post-661","post","type-post","status-publish","format-standard","hentry","category-cpp","category-programming"],"_links":{"self":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/661","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=661"}],"version-history":[{"count":1,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/661\/revisions"}],"predecessor-version":[{"id":3525,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/661\/revisions\/3525"}],"wp:attachment":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=661"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=661"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=661"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}