{"id":2199,"date":"2009-02-27T16:26:55","date_gmt":"2009-02-27T13:26:55","guid":{"rendered":"http:\/\/studentpmr.ru\/?p=2199"},"modified":"2009-02-27T16:26:55","modified_gmt":"2009-02-27T13:26:55","slug":"%d0%bf%d1%80%d0%be%d1%81%d1%82%d0%be%d0%b5-%d0%b8-%d0%bc%d0%bd%d0%be%d0%b6%d0%b5%d1%81%d1%82%d0%b2%d0%b5%d0%bd%d0%bd%d0%be%d0%b5-%d0%bd%d0%b0%d1%81%d0%bb%d0%b5%d0%b4%d0%be%d0%b2%d0%b0%d0%bd%d0%b8-2","status":"publish","type":"post","link":"https:\/\/studentpmr.ru\/?p=2199","title":{"rendered":"\u041f\u0440\u043e\u0441\u0442\u043e\u0435 \u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435. \u0412\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438"},"content":{"rendered":"<p>\u041f\u0440\u043e\u0441\u0442\u043e\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435<br \/>\n\u041f\u0440\u043e\u0441\u0442\u043e\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0440\u043e\u0434\u0441\u0442\u0432\u043e \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f  \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438: \u043e\u0434\u0438\u043d \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0432\u0442\u043e\u0440\u043e\u043c\u0443.  \u041a\u043b\u0430\u0441\u0441,  \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0439\u0441\u044f  \u043d\u0430 \u0432\u0435\u0440\u0448\u0438\u043d\u0435 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438, \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0431\u0430\u0437\u043e\u0432\u044b\u043c \u043a\u043b\u0430\u0441\u0441\u043e\u043c. \u041f\u0440\u043e\u0447\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u043c\u0438 \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438.<!--more--> \u0418\u0437 \u043e\u0434\u043d\u043e\u0433\u043e  \u043a\u043b\u0430\u0441\u0441\u0430  \u043c\u043e\u0433\u0443\u0442  \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u044b, \u043d\u043e \u0434\u0430\u0436\u0435 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u0432\u0438\u0434 \u0432\u0437\u0430\u0438\u043c\u043e\u0441\u0432\u044f\u0437\u0438 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435\u043c.<br \/>\n\u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0447\u0430\u0441\u0442\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043f\u0440\u0435\u0434\u043a\u043e\u043c, \u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 &#8212; \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u043c.<br \/>\n\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0437  \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e  \u0434\u0430\u043d\u043d\u044b\u0435-\u0447\u043b\u0435\u043d\u044b  \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438-\u0447\u043b\u0435\u043d\u044b, \u043d\u043e \u043d\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u044b \u0438 \u0434\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u044b.<br \/>\nclass  Tbase  {    \/\/\u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441<br \/>\nprivate:<br \/>\nint count;<br \/>\npublic:<br \/>\nTBase() {count = 0;}<br \/>\nvoid SetCount(int n) {count = n;}<br \/>\nint GetCount(void) {return count;}<br \/>\n};<br \/>\nclass TDerived: public TBase {  \/\/\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441<br \/>\npublic:<br \/>\nTDerived(): Tbase() {}<br \/>\nvoid ChangeCount(int n) {SetCount(GetCount() + n);}<br \/>\n};<\/p>\n<p>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0439  \u043a\u043b\u0430\u0441\u0441  \u043d\u0430\u0437\u0432\u0430\u043d  TDerived. \u0417\u0430  \u0438\u043c\u0435\u043d\u0435\u043c  \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0434\u0432\u043e\u0435\u0442\u043e\u0447\u0438\u0435 \u0438 \u043e\u0434\u043d\u043e \u0438\u0437 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u0441\u043b\u043e\u0432 &#8212; public,  protected,  private. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0438\u043c\u044f \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430  TBase.<br \/>\n\u041e\u0442\u043a\u0440\u044b\u0442\u044b\u0435  \u0447\u043b\u0435\u043d\u044b \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c\u0438 \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u043c  \u043a\u043b\u0430\u0441\u0441\u0435:<br \/>\nclass TDerived: public TBase {}<br \/>\n\u0412\u0441\u0435 \u0437\u0430\u043a\u0440\u044b\u0442\u044b\u0435 \u0447\u043b\u0435\u043d\u044b Tbase \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u0437\u0430\u043a\u0440\u044b\u0442\u044b\u043c\u0438 \u0438 \u0432  Tderived \u043d\u0435\u043b\u044c\u0437\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a \u043d\u0438\u043c \u0434\u043e\u0441\u0442\u0443\u043f.<br \/>\n\u041c\u043e\u0436\u043d\u043e \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u044b\u043c:<br \/>\nclass TDerived: protected TBase {}<br \/>\n\u041e\u0442\u043a\u0440\u044b\u0442\u044b\u0435 \u0447\u043b\u0435\u043d\u044b \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u044c\u0441\u044f \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u044b\u043c\u0438 \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u043c  \u043a\u043b\u0430\u0441\u0441\u0435.<br \/>\n\u041c\u043e\u0436\u043d\u043e \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0437\u0430\u043a\u0440\u044b\u0442\u044b\u043c:<br \/>\nclass TDerived: private TBase {}<br \/>\n\u0412\u0441\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0435 \u0447\u043b\u0435\u043d\u044b \u0432 \u0431\u0430\u0437\u043e\u0432\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f  \u0437\u0430\u043a\u0440\u044b\u0442\u044b\u043c\u0438 \u0432 TDerived. \u041f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f TDerived \u043d\u0435 \u0441\u043c\u043e\u0433\u0443\u0442  \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0432 \u0447\u043b\u0435\u043d\u0430\u043c TBase.<br \/>\n\u041e\u0431\u044b\u0447\u043d\u043e \u0432  \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u043c  \u043a\u043b\u0430\u0441\u0441\u0435  \u0435\u0441\u0442\u044c  \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440, \u0435\u0441\u043b\u0438 \u043e\u043d \u0431\u044b\u043b \u0432 \u0431\u0430\u0437\u043e\u0432\u043e\u043c. \u041e\u043d \u0434\u043e\u043b\u0436\u0435\u043d  \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c  \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430:<br \/>\nTDerived(): TBase() {}<br \/>\n\u041a\u0440\u043e\u043c\u0435 \u044d\u0442\u043e\u0433\u043e \u0432 \u043d\u0435\u043c \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f,  \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<br \/>\nTDerived():TBase() {cout &lt;&lt;&#187; I am  being  initialized&#187; &lt;&lt;endl;}<br \/>\n\u041c\u043e\u0436\u043d\u043e  \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c  \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u0439  \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440    \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e:<br \/>\nTDerived::TDerived()<br \/>\n: TBase()<br \/>\n{ \/\/ \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b<br \/>\n}<br \/>\n\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442 count \u0438\u0437 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u043d\u043e \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d \u0437\u0430\u043a\u0440\u044b\u0442 \u0432 TBase \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0435\u043c\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u0435\u043d  \u0442\u043e\u043b\u044c\u043a\u043e  \u0447\u0435\u0440\u0435\u0437  \u0444\u0443\u043d\u043a\u0446\u0438\u0438-\u0447\u043b\u0435\u043d\u044b \u043a\u043b\u0430\u0441\u0441\u0430 TBase. \u0412 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u043c  \u043a\u043b\u0430\u0441\u0441\u0435  \u043c\u043e\u0436\u043d\u043e  \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u043c  \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c-\u0447\u043b\u0435\u043d\u0430\u043c \u043a\u043b\u0430\u0441\u0441\u0430 TBase:<br \/>\nvoid ChangeCount(int n)  {SetCount(GetCount() +n);}<br \/>\n\u0417\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u044b\u0435 \u0447\u043b\u0435\u043d\u044b \u043a\u043b\u0430\u0441\u0441\u0430 &#8212; \u044d\u0442\u043e \u043d\u0435\u0447\u0442\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u043c\u0435\u0436\u0434\u0443  \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c\u0438 \u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u044b\u043c\u0438 \u0447\u043b\u0435\u043d\u0430\u043c\u0438. \u041f\u043e\u0434\u043e\u0431\u043d\u043e \u0437\u0430\u043a\u0440\u044b\u0442\u044b\u043c \u043e\u043d\u0438  \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b  \u0442\u043e\u043b\u044c\u043a\u043e  \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c-\u0447\u043b\u0435\u043d\u0430\u043c \u043a\u043b\u0430\u0441\u0441\u0430. \u0412\u043d\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 \u043e\u043d\u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b. \u041f\u043e\u0434\u043e\u0431\u043d\u043e  \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u043e\u043d\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c-\u0447\u043b\u0435\u043d\u0430\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432.<br \/>\n&#8212;\t\u0437\u0430\u043a\u0440\u044b\u0442\u044b\u0435 \u0447\u043b\u0435\u043d\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0432  \u0442\u043e\u043c  \u043a\u043b\u0430\u0441\u0441\u0435,  \u0432  \u043a\u043e\u0442\u043e\u0440\u043e\u043c  \u043e\u043d\u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u044b;<br \/>\n&#8212;\t\u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u044b\u0435 \u0447\u043b\u0435\u043d\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0447\u043b\u0435\u043d\u0430\u043c \u0438\u0445 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0438  \u0432\u0441\u0435\u043c \u0447\u043b\u0435\u043d\u0430\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432;<br \/>\n&#8212;\t\u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0435 \u0447\u043b\u0435\u043d\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0447\u043b\u0435\u043d\u0430\u043c \u0438\u0445 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e  \u043a\u043b\u0430\u0441\u0441\u0430,  \u0447\u043b\u0435\u043d\u0430\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0438 \u0432\u0441\u0435\u043c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u044d\u0442\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430.<br \/>\n\u0421\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b (public, private, protected) \u0432\u043b\u0438\u044f\u044e\u0442 \u043d\u0430 \u0441\u0442\u0430\u0442\u0443\u0441 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c\u044b\u0445 \u0447\u043b\u0435\u043d\u043e\u0432:<br \/>\n&#8212;\t\u0447\u043b\u0435\u043d\u044b \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0433\u043e \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435  \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e\u0442 \u0441\u0432\u043e\u0438 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430;<br \/>\n&#8212;\t\u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0435 \u0447\u043b\u0435\u043d\u044b \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u043e\u0433\u043e \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f  \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u044b\u043c\u0438 \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435. \u0417\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u044b\u0435  \u0438  \u0437\u0430\u043a\u0440\u044b\u0442\u044b\u0435  \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e\u0442  \u0441\u0432\u043e\u0438 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438;<br \/>\n&#8212;\t\u0432\u0441\u0435 \u0447\u043b\u0435\u043d\u044b \u0437\u0430\u043a\u0440\u044b\u0442\u043e\u0433\u043e  \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e  \u043a\u043b\u0430\u0441\u0441\u0430  \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f  \u0437\u0430\u043a\u0440\u044b\u0442\u044b\u043c\u0438  \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0438\u0445  \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439  \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430.<br \/>\n\u0415\u0441\u043b\u0438  \u0445\u043e\u0442\u0438\u0442\u0435  \u0441\u0434\u0435\u043b\u0430\u0442\u044c  \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c\u0438  \u0432  \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u043c  \u043a\u043b\u0430\u0441\u0441\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c\u044b\u0445 \u0447\u043b\u0435\u043d\u043e\u0432, \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u043e\u0440\u043e\u0447\u043d\u043e  \u043a\u0432\u0430\u043b\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u043d\u0438\u0445.<br \/>\nclass A {<br \/>\npublic:<br \/>\nint x;<br \/>\nA() { x=0;}<br \/>\nvoid Display(void) { count &lt;&lt; &#171;x = &#187; &lt;&lt; x &lt;&lt; endl;}<br \/>\n};<br \/>\nclass B: private A {<br \/>\npublic:<br \/>\nA::Display; \/\/ \u043a\u0432\u0430\u043b\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u043c \u043a\u0430\u043a \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0447\u043b\u0435\u043d \u043a\u043b\u0430\u0441\u0441\u0430<\/p>\n<p>B(): A() {}<br \/>\n};<br \/>\n\u0412 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435 \u0434\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043d\u0443\u0436\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u043e\u043c  \u0441\u043b\u0443\u0447\u0430\u0435,  \u0435\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0447\u0442\u043e-\u0442\u043e \u0443\u0434\u0430\u043b\u044f\u0442\u044c.<br \/>\n\/\/ \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 1<br \/>\n#include &lt;iostream.h&gt;<br \/>\n#include &lt;string.h&gt;<\/p>\n<p>class TBase {    \/\/\u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441<br \/>\nprivate:<br \/>\nchar *basep;<br \/>\npublic:<br \/>\nTBase(const char *s) {basep = strdup(s); }<br \/>\n~TBase() {delete basep;}<br \/>\nconst char *GetStr(void) { return basep; }<br \/>\n};<\/p>\n<p>class TDerived: public TBase {  \/\/\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441<br \/>\nprivate:<br \/>\nchar *uppercasep;<br \/>\npublic:<br \/>\nTDerived(const char* s): TBase(s) { uppercasep = strupr(strdup(s));}<br \/>\n~TDerived() {delete uppercasep;}<br \/>\nconst char *GetUStr(void) { return uppercasep;}<\/p>\n<p>};<br \/>\nvoid main()<br \/>\n{<br \/>\nTBase president(&#171;George Washington&#187;);<br \/>\ncout &lt;&lt; &#171;Original string: &#187; &lt;&lt; president.GetStr() &lt;&lt; endl;<br \/>\nTDerived pres(&#171;George Washington&#187;);<br \/>\ncout &lt;&lt; &#171;Uppercase string:&#187; &lt;&lt; pres.GetUStr() &lt;&lt; endl;<br \/>\n}<br \/>\n\u0412 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435  \u043e\u0431\u044b\u0447\u043d\u043e  \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f  \u043d\u043e\u0432\u044b\u0435  \u0434\u0430\u043d\u043d\u044b\u0435  \u0438  \u0444\u0443\u043d\u043a\u0446\u0438\u0438-\u0447\u043b\u0435\u043d\u044b. \u041e\u0434\u043d\u0430\u043a\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u043c\u0435\u0449\u0435\u043d\u0438\u044f  \u0444\u0443\u043d\u043a\u0446\u0438\u0439-\u0447\u043b\u0435\u043d\u043e\u0432, \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043e\u0442 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<br \/>\n\/\/\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 2<br \/>\n#include &lt;iostream.h&gt;<br \/>\n#include &lt;string.h&gt;<br \/>\nclass TBase {    \/\/\u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441<br \/>\nprivate:<br \/>\nchar *basep;<br \/>\npublic:<br \/>\nTBase(const char *s) {basep = strdup(s); }<br \/>\n~TBase() {delete basep;}<br \/>\nvoid Display(void) { cout &lt;&lt; basep &lt;&lt; endl;}<br \/>\n};<br \/>\nclass TState: public TBase {    \/\/\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441<br \/>\npublic:<br \/>\nTState(const char *s):TBase (s) {}<br \/>\nvoid Display(void); \/\/ \u0437\u0430\u043c\u0435\u0449\u0430\u044e\u0449\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f<br \/>\n};<\/p>\n<p>void TState::Display(void)<br \/>\n{<br \/>\ncout &lt;&lt; &#171;State: &#171;;  \/\/\u041d\u043e\u0432\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440<br \/>\nTBase::Display();   \/\/\u0412\u044b\u0437\u043e\u0432 \u0437\u0430\u043c\u0435\u0449\u0435\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<br \/>\n}<br \/>\nvoid main()<br \/>\n{<br \/>\nTState object(&#171;Welcome to Borland C++5 programming!&#187;);<br \/>\nobject.Display();<br \/>\n}<br \/>\n4.2. \u041c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435<br \/>\n\u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e: \u0432\u043c\u0435\u0441\u0442\u043e \u0438\u043c\u0435\u043d\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 (\u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0435\u0433\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c) \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u043c\u0435\u043d, \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u0437\u0430\u043f\u044f\u0442\u044b\u043c\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<br \/>\nclass A { \/*\u2026*\/ };<br \/>\nclass B { \/*\u2026*\/ };<\/p>\n<p>class C: public A, private B { \/*\u2026*\/ };<\/p>\n<p>\u041f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430\u043c \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0438\u0437 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0442\u0430\u043a \u0436\u0435 \u043a\u0430\u043a \u0438 \u0440\u0430\u043d\u044c\u0448\u0435:<br \/>\n\u0421::\u0421( int a, char* str) : A(a), B(str) { \/*\u2026*\/ };<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041f\u0440\u043e\u0441\u0442\u043e\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u041f\u0440\u043e\u0441\u0442\u043e\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0440\u043e\u0434\u0441\u0442\u0432\u043e \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438: \u043e\u0434\u0438\u043d \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0432\u0442\u043e\u0440\u043e\u043c\u0443. \u041a\u043b\u0430\u0441\u0441, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0439\u0441\u044f \u043d\u0430 \u0432\u0435\u0440\u0448\u0438\u043d\u0435 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438, \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0431\u0430\u0437\u043e\u0432\u044b\u043c \u043a\u043b\u0430\u0441\u0441\u043e\u043c. \u041f\u0440\u043e\u0447\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u043c\u0438 \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"_links":{"self":[{"href":"https:\/\/studentpmr.ru\/index.php?rest_route=\/wp\/v2\/posts\/2199"}],"collection":[{"href":"https:\/\/studentpmr.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/studentpmr.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/studentpmr.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/studentpmr.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2199"}],"version-history":[{"count":1,"href":"https:\/\/studentpmr.ru\/index.php?rest_route=\/wp\/v2\/posts\/2199\/revisions"}],"predecessor-version":[{"id":2200,"href":"https:\/\/studentpmr.ru\/index.php?rest_route=\/wp\/v2\/posts\/2199\/revisions\/2200"}],"wp:attachment":[{"href":"https:\/\/studentpmr.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/studentpmr.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/studentpmr.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}