{"id":1730,"date":"2009-02-24T16:29:29","date_gmt":"2009-02-24T13:29:29","guid":{"rendered":"http:\/\/studentpmr.ru\/?p=1730"},"modified":"2009-02-24T16:29:29","modified_gmt":"2009-02-24T13:29:29","slug":"%d0%bf%d1%80%d0%b8%d1%81%d0%b2%d0%b0%d0%b8%d0%b2%d0%b0%d0%bd%d0%b8%d0%b5-%d0%b8-%d0%b8%d0%bd%d0%b8%d1%86%d0%b8%d0%b0%d0%bb%d0%b8%d0%b7%d0%b0%d1%86%d0%b8%d1%8f","status":"publish","type":"post","link":"http:\/\/studentpmr.ru\/?p=1730","title":{"rendered":"\u041f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f"},"content":{"rendered":"<p>\u0420\u0430\u0441\u0441\u043c-\u043c  \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 \u0441\u0442\u0440\u043e\u043a string:  struct string { char* p;<br \/>\nint size; \/\/ \u0440\u0430\u0437\u043c\u0435\u0440 \u0432\u0435\u043a\u0442\u043e\u0440\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439            \/\/ \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 p   string(int sz) { p = new char[size=sz]; }   ~string() { delete p; }  };  \u0421\u0442\u0440\u043e\u043a\u0430-\u044d\u0442\u043e \u0441\u0442\u0440-\u0440\u0430 \u0434-\u044b\u0445, \u0441\u043e\u0441\u0442-\u0430\u044f \u0438\u0437 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0438 \u0434\u043b\u0438\u043d\u044b \u044d\u0442\u043e\u0433\u043e \u0432\u0435\u043a\u0442\u043e\u0440\u0430.\u0412\u0435\u043a\u0442\u043e\u0440 \u0441\u043e\u0437\u0434-\u0441\u044f \u043a\u043e\u043d\u0441\u0442\u0440-\u0440\u043e\u043c \u0438 \u0443\u043d\u0438\u0447\u0442-\u0441\u044f \u0434\u0435\u0441\u0442\u0440-\u0440\u043e\u043c.<!--more-->\u041d\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0441\u0442\u044f\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:  void f(){string s1(10);string s2(20);s1=s2;} \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0442\u044c \u0434\u0432\u0430 \u0432-\u0440\u0430 \u0441\u0438\u043c\u0432-\u0432,\u0430 \u043f\u0440\u0438\u0441\u0432-\u0438\u0435 s1=s2 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0440\u0442\u0438\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043e\u0434\u0438\u043d \u0438\u0437 \u043d\u0438\u0445 \u0438 \u0434\u0443\u0431\u043b\u0438\u0440-\u0442\u044c \u0434\u0440-\u043e\u0439. \u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u0438\u0437f() \u0434\u043b\u044f s1 \u0438 s2 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u044b\u0432-\u0441\u044f \u0434\u0435\u0441\u0442\u0440-\u0440 \u0438 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u0432\u0435\u043a\u0442\u043e\u0440 \u0441 \u043d\u0435\u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e \u0440\u0430\u0437\u0440\u0443\u0448\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f\u043c\u0438. \u0420\u0435\u0448-\u0438\u0435 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441\u043e\u0441\u0442-\u0442  \u043f\u0440\u0438\u0441\u0432-\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0442\u0438\u043f\u0430 string \u0441\u043e\u043e\u0442\u0432-\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<br \/>\nstruct string{char* p;<br \/>\nint size; \/\/ \u0440\u0430\u0437\u043c\u0435\u0440 \u0432\u0435\u043a\u0442\u043e\u0440\u0430,\u043d\u0430 \u043a-\u044b\u0439 \u0443\u043a-\u0435\u0442 p   string(int sz) { p = new char[size=sz]; }   ~string() { delete p; }   void operator=(string&amp;) }; void string::operator=(string&amp; a) {      if (this == &amp;a) return;  \/\/ \u043e\u0441\u0442\u0435\u0440\u0435\u0433\u0430\u0442\u044c\u0441\u044f<br \/>\ns=s; delete p; p=new char[size=a.size];<br \/>\nstrcpy(p,a.p);} \u042d\u0442\u043e \u043e\u043f\u0440-\u0438\u0435 string \u0433\u0430\u0440-\u0435\u0442, \u0438 \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u044b\u0434-\u0438\u0439 \u043f\u0440-\u0440  \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043a\u0430\u043a \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u043b\u043e\u0441\u044c. \u041d\u043e \u043d\u0435\u0431-\u043e\u0435 \u0438\u0437\u043c-\u0438\u0435 f() \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u043f\u043e\u044f\u0432\u043b-\u0438\u044e \u0442\u043e\u0439 \u0436\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432 \u043d\u043e\u0432\u043e\u043c \u043e\u0431\u043b\u0438\u043a\u0435:    void f(){string s1(10); s2 = s1;} \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434-\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0430, \u0430 \u0443\u043d\u0438\u0447\u0442-\u0441\u044f \u0434\u0432\u0435. \u041a \u043d\u0435\u0438\u043d\u0438\u0446-\u043e\u043c\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0443 \u043e\u043f\u0435\u0440-\u0438\u044f \u043f\u0440\u0438\u0441\u0432-\u0438\u044f, \u043e\u043f\u0440-\u0430\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432-\u0435\u043c,\u043d\u0435 \u043f\u0440\u0438\u043c-\u0441\u044f. \u0427\u0442\u043e \u043d\u0435 \u0436\u0435\u043b-\u043d\u043e, \u0442.\u043a. \u0438\u0437 \u043e\u043f\u0440.operate=\u2026\u0441\u043b-\u0435\u0442,\u0447\u0442\u043e \u0443\u043a-\u043b\u044c \u0440 \u0441\u043e\u0434-\u043b \u0431\u044b \u043d\u0435\u043e\u043f\u0440-\u043e\u0435 \u0438 \u0441\u043e\u0432\u0435\u0440-\u043d\u043e \u0441\u043b\u0443\u0447-\u043e\u0435 \u0437\u043d\u0430\u0447-\u0438\u0435. \u0427\u0430\u0441\u0442\u043e<br \/>\n\u043e\u043f\u0435\u0440-\u0438\u044f \u043f\u0440\u0438\u0441\u0432-\u0438\u044f \u043f\u043e\u043b\u0430\u0433-\u0441\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0435\u0435 \u0430\u0440\u0433-\u0442\u044b \u0438\u043d\u0438\u0446-\u043d\u044b. \u0414\u043b\u044f \u0442\u0430\u043a\u043e\u0439 \u0438\u043d\u0438\u0446-\u0438\u0438, \u043a\u0430\u043a \u0437\u0434\u0435\u0441\u044c,\u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a \u043f\u043e \u043e\u043f\u0440-\u0438\u044e. \u0421\u043b\u0435\u0434-\u043d\u043e,\u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0440-\u0442\u044c \u0430\u043d\u0430\u043b-\u0443\u044e,\u043d\u043e \u043e\u0442\u0434-\u0443\u044e \u0444-\u0438\u044e:  struct string { char* p;<br \/>\nint size;\/\/\u0440\u0430\u0437\u043c\u0435\u0440 \u0432-\u0440\u0430,\u043d\u0430 \u043a-\u044b\u0439 \u0443\u043a-\u0435\u0442 p   string(int sz) { p = new char[size=sz]; }   ~string() { delete p; }   void operator=(string&amp;); string(string&amp;);<br \/>\n};<br \/>\nvoid string::string(string&amp; a) {<br \/>\np=new char[size=a.size]; strcpy(p,a.p);}<br \/>\n\u0414\u043b\u044f \u0442\u0438\u043f\u0430 X \u0438\u043d\u0438\u0446-\u0438\u044e \u0442\u0435\u043c \u0436\u0435 \u0442\u0438\u043f\u043e\u043c X \u043e\u0431\u0440\u0430\u0431-\u0435\u0442 \u043a\u043e\u043d\u0441\u0442\u0440-\u0440X(X&amp;). \u041f\u0440\u0438\u0441\u0432-\u0438\u0435 \u0438 \u0438\u043d\u0438\u0446-\u0438\u044f-\u0440\u0430\u0437\u043d\u044b\u0435 \u0434-\u0438\u044f, \u0441\u0443\u0449-\u043d\u043e \u043f\u0440\u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0434\u0435\u0441\u0442\u0440-\u0440\u0430. \u0415\u0441\u043b\u0438 \u043a\u043b\u0430\u0441\u0441 X \u0438\u043c\u0435\u0435\u0442 \u043a\u043e\u043d\u0441\u0442\u0440-\u0440 X(X&amp;),\u0432\u044b\u043f-\u0438\u0439 \u043d\u0435\u0442\u0440\u0438\u0432-\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u0432\u0440\u043e\u0434\u0435 \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438, \u0442\u043e \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u043e\u0442\u0440\u0435\u0431-\u0441\u044f \u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0442 \u0444-\u0438\u0439 \u0434\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u043d\u0438\u044f \u043f\u043e\u0431\u0438\u0442-\u0433\u043e \u043a\u043e\u043f\u0438\u0440-\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432:<br \/>\nclass X {\/\/ &#8230;<br \/>\nsomething);\/\/\u043a\u043e\u043d\u0441\u0442\u0440-\u0440:\u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442<br \/>\nX(&amp;X);\/\/\u043a\u043e\u043d\u0441\u0442\u0440-\u0440:\u043a\u043e\u043f-\u0435\u0442 \u0432 \u0438\u043d\u0438\u0446-\u0438\u0438 operator=(X&amp;);\/\/\u043f\u0440\u0438\u0441\u0432-\u0438\u0435: \u0447\u0438\u0441\u0442\u0438\u0442 \u0438 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442   ~X(); \/\/ \u0434\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440: \u0447\u0438\u0441\u0442\u0438\u0442<br \/>\n};<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0420\u0430\u0441\u0441\u043c-\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 \u0441\u0442\u0440\u043e\u043a string: struct string { char* p; int size; \/\/ \u0440\u0430\u0437\u043c\u0435\u0440 \u0432\u0435\u043a\u0442\u043e\u0440\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \/\/ \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 p string(int sz) { p = new char[size=sz]; } ~string() { delete p; } }; \u0421\u0442\u0440\u043e\u043a\u0430-\u044d\u0442\u043e \u0441\u0442\u0440-\u0440\u0430 \u0434-\u044b\u0445, \u0441\u043e\u0441\u0442-\u0430\u044f \u0438\u0437 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0438 \u0434\u043b\u0438\u043d\u044b \u044d\u0442\u043e\u0433\u043e \u0432\u0435\u043a\u0442\u043e\u0440\u0430.\u0412\u0435\u043a\u0442\u043e\u0440 \u0441\u043e\u0437\u0434-\u0441\u044f \u043a\u043e\u043d\u0441\u0442\u0440-\u0440\u043e\u043c \u0438 \u0443\u043d\u0438\u0447\u0442-\u0441\u044f \u0434\u0435\u0441\u0442\u0440-\u0440\u043e\u043c.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58],"tags":[],"_links":{"self":[{"href":"http:\/\/studentpmr.ru\/index.php?rest_route=\/wp\/v2\/posts\/1730"}],"collection":[{"href":"http:\/\/studentpmr.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/studentpmr.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/studentpmr.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/studentpmr.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1730"}],"version-history":[{"count":1,"href":"http:\/\/studentpmr.ru\/index.php?rest_route=\/wp\/v2\/posts\/1730\/revisions"}],"predecessor-version":[{"id":1731,"href":"http:\/\/studentpmr.ru\/index.php?rest_route=\/wp\/v2\/posts\/1730\/revisions\/1731"}],"wp:attachment":[{"href":"http:\/\/studentpmr.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1730"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/studentpmr.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1730"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/studentpmr.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1730"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}