{"id":273260,"date":"2016-01-31T12:33:03","date_gmt":"2016-01-31T09:33:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=273260"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=273260","title":{"rendered":"man!( C =&gt; D )"},"content":{"rendered":"<p>       \u041a\u0430\u0436\u0434\u044b\u0439 \u0421-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u0441 \u043e\u043f\u044b\u0442\u043e\u043c \u043d\u0430\u043a\u0430\u043f\u043b\u0438\u0432\u0430\u0435\u0442 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0439 \u0431\u0430\u0433\u0430\u0436 \u0442\u0435\u0445\u043d\u0438\u043a \u0438 \u0438\u0434\u0438\u043e\u043c. \u0417\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u0431\u044b\u0432\u0430\u0435\u0442 \u0441\u043b\u043e\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0432 \u043d\u043e\u0432\u043e\u043c \u044f\u0437\u044b\u043a\u0435. \u0422\u0430\u043a \u0432\u043e\u0442, \u0432\u0430\u0448\u0435\u043c\u0443 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0445 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432 \u043d\u0430 C \u0438 \u0438\u0445 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 D. \u0415\u0441\u043b\u0438 \u0432\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0435\u0441\u044c \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u0441\u0432\u043e\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0441 C \u043d\u0430 D \u0438\u043b\u0438 \u0435\u0449\u0451 \u0441\u043e\u043c\u043d\u0435\u0432\u0430\u0435\u0442\u0435\u0441\u044c \u0441\u0442\u043e\u0438\u0442 \u043b\u0438 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u0442\u043e \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0434\u043b\u044f \u0432\u0430\u0441.<\/p>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<h4>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440 \u0442\u0438\u043f\u0430 \u0432 \u0431\u0430\u0439\u0442\u0430\u0445<\/h4>\n<p>  \u0412 C \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<pre><code class=\"cpp\">sizeof( int ) sizeof( char * ) sizeof( double ) sizeof( struct Foo ) <\/code><\/pre>\n<p>  \u0412 D \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0435\u0441\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e:<\/p>\n<pre><code class=\"cpp\">int.sizeof (char*).sizeof double.sizeof Foo.sizeof <\/code><\/pre>\n<h4>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430<\/h4>\n<p>  \u0411\u044b\u043b\u043e \u043d\u0430 C:<\/p>\n<pre><code class=\"cpp\">#include &lt;limits.h&gt; #include &lt;math.h&gt;  CHAR_MAX CHAR_MIN ULONG_MAX DBL_MIN<\/code><\/pre>\n<p>  \u0421\u0442\u0430\u043b\u043e \u043d\u0430 D:<\/p>\n<pre><code class=\"cpp\">char.max char.min ulong.max double.min <\/code><\/pre>\n<h4>\u0422\u0430\u0431\u043b\u0438\u0446\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f \u0442\u0438\u043f\u043e\u0432 C =&gt; D<\/h4>\n<p>  <\/p>\n<pre><code class=\"cpp\">bool               =&gt;        bool char               =&gt;        char signed char        =&gt;        byte unsigned char      =&gt;        ubyte short              =&gt;        short unsigned short     =&gt;        ushort wchar_t            =&gt;        wchar int                =&gt;        int unsigned           =&gt;        uint long               =&gt;        int unsigned long      =&gt;        uint long long          =&gt;        long unsigned long long =&gt;        ulong float              =&gt;        float double             =&gt;        double long double        =&gt;        real _Imaginary long double =&gt;    ireal _Complex long double   =&gt;    creal<\/code><\/pre>\n<h4>\u041e\u0441\u043e\u0431\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u0435\u043b \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439<\/h4>\n<p>  \u0411\u044b\u043b\u043e \u043d\u0430 C:<\/p>\n<pre><code class=\"cpp\">#include &lt;fp.h&gt;  NAN INFINITY  #include &lt;float.h&gt;  DBL_DIG DBL_EPSILON DBL_MANT_DIG DBL_MAX_10_EXP DBL_MAX_EXP DBL_MIN_10_EXP DBL_MIN_EXP <\/code><\/pre>\n<p>  \u0421\u0442\u0430\u043b\u043e \u043d\u0430 D:<\/p>\n<pre><code class=\"cpp\">double.nan double.infinity double.dig double.epsilon double.mant_dig double.max_10_exp double.max_exp double.min_10_exp double.min_exp <\/code><\/pre>\n<h4>\u041e\u0441\u0442\u0430\u0442\u043e\u043a \u043e\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b<\/h4>\n<p>  \u0412 C \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<pre><code class=\"cpp\">#include &lt;math.h&gt;  float f = fmodf( x , y ); double d = fmod( x , y ); long double r = fmodl( x , y ); <\/code><\/pre>\n<p>  D \u0438\u043c\u0435\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"cpp\">float f = x % y; double d = x % y; real r = x % y; <\/code><\/pre>\n<h4>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 NaN \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439<\/h4>\n<p>  \u0412 C \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441 NaN \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u043c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c \u0438 \u0440\u0430\u0437\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u044b \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443 \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u044e\u0442 (\u043e\u0442 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043e \u0432\u043e\u0437\u0431\u0443\u0436\u0434\u0435\u043d\u0438\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f), \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code class=\"cpp\">#include &lt;math.h&gt;  if( isnan( x ) || isnan( y ) ) {     result = FALSE; } else {     result = ( x &lt; y ); } <\/code><\/pre>\n<p>  \u0412 D \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441 NaN \u2014 \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 false:<\/p>\n<pre><code class=\"cpp\">result = ( x &lt; y );        \/\/ false if x or y is nan <\/code><\/pre>\n<h4>\u0410\u0441\u0435\u0440\u0442\u044b \u2014 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043e\u043a<\/h4>\n<p>  \u0412 C \u043d\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u0430\u0441\u0435\u0440\u0442\u043e\u0432, \u043d\u043e \u043e\u043d \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043f\u0441\u0435\u0432\u0434\u043e\u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b __FILE__, __LINE__ \u0438 \u043c\u0430\u043a\u0440\u043e\u0441\u044b, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u0441\u0435\u0440\u0442\u044b (\u043f\u043e \u0444\u0430\u043a\u0442\u0443, \u0443 \u044d\u0442\u0438\u0445 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442 \u043d\u0435\u0442 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f):<\/p>\n<pre><code class=\"cpp\">#include &lt;assert.h&gt;  assert( e == 0 ); <\/code><\/pre>\n<p>  D \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0430\u0441\u0435\u0440\u0442\u044b \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u044f\u0437\u044b\u043a\u0430:<\/p>\n<pre><code class=\"cpp\">assert( e == 0 ); <\/code><\/pre>\n<h4>\u0418\u0442\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0443<\/h4>\n<p>  \u041d\u0430 C \u0432 \u0437\u0430\u0434\u0430\u0451\u0442\u0435 \u0434\u043b\u0438\u043d\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043e\u0439, \u0430 \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u043e\u0431\u0435\u0433\u0430\u0435\u0442\u0435\u0441\u044c \u043f\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0443 \u0433\u0440\u043e\u043c\u043e\u0437\u0434\u043a\u0438\u043c for-\u0446\u0438\u043a\u043b\u043e\u043c:<\/p>\n<pre><code class=\"cpp\">#define ARRAY_LENGTH 17 int array[ ARRAY_LENGTH ]; for( i = 0 ; i &lt; ARRAY_LENGTH ; i++ ) {     func( array[i] ); } <\/code><\/pre>\n<p>  \u0412\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0443\u043a\u043b\u044e\u0436\u0435\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0441 sizeof(), \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u043c\u0435\u043d\u044f\u0435\u0442 \u0434\u0435\u043b\u043e:<\/p>\n<pre><code class=\"cpp\">int array[17]; for( i = 0 ; i &lt; sizeof( array ) \/ sizeof( array[0] ) ; i++ ) {     func( array[i] ); } <\/code><\/pre>\n<p>  \u0412 D \u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e length:<\/p>\n<pre><code class=\"cpp\">int array[17]; foreach( i ; 0 .. array.length ) {      func( array[i] ); } <\/code><\/pre>\n<p>  \u041d\u043e, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c, \u043b\u0443\u0447\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c foreach-\u0446\u0438\u043a\u043b:<\/p>\n<pre><code class=\"cpp\">int array[17]; foreach( value ; array ) {     func( value ); } <\/code><\/pre>\n<h4>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0430<\/h4>\n<p>  \u041d\u0430 C \u0432\u044b \u0432\u044b\u043d\u0443\u0436\u0434\u0435\u043d\u044b \u0431\u044b\u043b\u0438 \u043f\u0440\u043e\u0431\u0435\u0433\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0443 \u0432 \u0446\u0438\u043a\u043b\u0435 (\u0438\u043b\u0438 \u043e\u043f\u044f\u0442\u044c \u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u043a\u0440\u043e\u0441):<\/p>\n<pre><code class=\"cpp\">#define ARRAY_LENGTH 17 int array[ ARRAY_LENGTH ]; for( i = 0 ; i &lt; ARRAY_LENGTH ; i++ ) {     array[i] = value; } <\/code><\/pre>\n<p>  D \u0438\u043c\u0435\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u043d\u043e\u0442\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0447\u0430\u0441\u0442\u043e\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u044f:<\/p>\n<pre><code class=\"cpp\">int array[17]; array[] = value; <\/code><\/pre>\n<h4>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b<\/h4>\n<p>  C \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0442\u0430\u043a\u0438\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0437\u0430\u0432\u043e\u0434\u0438\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0434\u043b\u044f \u0434\u043b\u0438\u043d\u044b \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043f\u0430\u043c\u044f\u0442\u0438:<\/p>\n<pre><code class=\"cpp\">#include &lt;stdlib.h&gt;  int array_length; int *array; int *newarray;  newarray = (int *) realloc( array , ( array_length + 1 ) * sizeof( int ) ); if( !newarray ) error( &quot;out of memory&quot; ); array = newarray; array[ array_length++ ] = x; <\/code><\/pre>\n<p>  D \u0438\u043c\u0435\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0443\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b \u0438 \u0441\u0430\u043c \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e:<\/p>\n<pre><code class=\"cpp\">int[] array; int x; array.length = array.length + 1; array[ array.length - 1 ] = x; <\/code><\/pre>\n<h4>\u0421\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a<\/h4>\n<p>  \u041d\u0430 C \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0440\u0435\u0448\u0430\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0442\u0438\u043f\u0430 \u00ab\u043a\u043e\u0433\u0434\u0430 \u043f\u0430\u043c\u044f\u0442\u044c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0430\u00bb, \u00ab\u043a\u0430\u043a \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043d\u0443\u043b\u0435\u0432\u044b\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438\u00bb, \u00ab\u043a\u0430\u043a \u0443\u0437\u043d\u0430\u0442\u044c \u0434\u043b\u0438\u043d\u0443 \u0441\u0442\u0440\u043e\u043a\u0438\u00bb, \u00ab\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u043c\u044f\u0442\u0438 \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c\u00bb \u0438 \u0434\u0440\u0443\u0433\u0438\u0435:<\/p>\n<pre><code class=\"cpp\">#include &lt;string.h&gt;  char *s1; char *s2; char *s;  \/\/ Concatenate s1 and s2, and put result in s free(s); s = (char *) malloc( ( s1 ? strlen( s1 ) : 0 ) + ( s2 ? strlen( s2 ) : 0 ) + 1 ); if( !s ) error( &quot;out of memory&quot; ); if( s1 ) {     strcpy( s, s1 ); } else {     *s = 0; } if( s2 ) {     strcpy( s + strlen( s ) , s2 ); }  \/\/ Append &quot;hello&quot; to s char hello[] = &quot;hello&quot;; char *news; size_t lens = s ? strlen( s ) : 0; news = (char *) realloc( s , ( lens + sizeof( hello ) + 1 ) * sizeof( char ) ); if( !news ) error( &quot;out of memory&quot; ); s = news; memcpy( s + lens , hello , sizeof( hello ) ); <\/code><\/pre>\n<p>  \u0412 D \u0435\u0441\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0430\u0435\u043c\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b ~ \u0438 ~= \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u043e\u0432:<\/p>\n<pre><code class=\"cpp\">char[] s1; char[] s2; char[] s;  s = s1 ~ s2; s ~= &quot;hello&quot;; <\/code><\/pre>\n<h4>\u0424\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434<\/h4>\n<p>  \u0412 C \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u0432\u043e\u0434\u0430 \u2014 \u044d\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f printf():<\/p>\n<pre><code class=\"cpp\">#include &lt;stdio.h&gt;  printf( &quot;Calling all cars %d times!\\n&quot; , ntimes ); <\/code><\/pre>\n<p>  \u0427\u0442\u043e \u043c\u044b \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0432 D? \u0414\u0430 \u043f\u043e\u0447\u0442\u0438 \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435:<\/p>\n<pre><code class=\"cpp\">import std.stdio;  writefln( &quot;Calling all cars %s times!&quot; , ntimes ); <\/code><\/pre>\n<p>  \u041d\u043e \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 printf, writef \u0442\u0438\u043f\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u0435\u043d, \u0442\u043e \u0435\u0441\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0442\u0438\u043f\u0430\u043c \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435.<\/p>\n<h4>\u041e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c \u0434\u043e \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f<\/h4>\n<p>  \u0412 C \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u043b \u0435\u0451 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043b\u0438\u0431\u043e \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u044c \u0441\u0430\u043c\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043b\u0438\u0431\u043e, \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u043d\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u0435\u043d, \u0442\u043e \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0446\u0438\u044e, \u0433\u043e\u0432\u043e\u0440\u044f\u0449\u0443\u044e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0430 \u043f\u043e\u0437\u0436\u0435:<\/p>\n<pre><code class=\"cpp\">void forwardfunc();  void myfunc() {     forwardfunc(); }  void forwardfunc() {     ... } <\/code><\/pre>\n<p>  \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 D \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0444\u0430\u0439\u043b \u0446\u0435\u043b\u0438\u043a\u043e\u043c, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0439 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u0445:<\/p>\n<pre><code class=\"cpp\">void myfunc() {     forwardfunc(); }  void forwardfunc() {     ... } <\/code><\/pre>\n<h4>\u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0431\u0435\u0437 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432<\/h4>\n<p>  \u0411\u044b\u043b\u043e \u043d\u0430 C:<\/p>\n<pre><code class=\"cpp\">void foo( void ); <\/code><\/pre>\n<p>  \u0421\u0442\u0430\u043b\u043e \u043d\u0430 D:<\/p>\n<pre><code class=\"cpp\">void foo() {     ... } <\/code><\/pre>\n<h4>\u0412\u044b\u0445\u043e\u0434 \u0438\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0431\u043b\u043e\u043a\u043e\u0432 \u043a\u043e\u0434\u0430<\/h4>\n<p>  \u0412 C \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b break \u0438 continue \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0432\u044b\u0439\u0442\u0438 \u043b\u0438\u0448\u044c \u043d\u0430 \u043e\u0434\u0438\u043d \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0432\u0432\u0435\u0440\u0445. \u0427\u0442\u043e\u0431\u044b \u0432\u044b\u0439\u0442\u0438 \u0441\u0440\u0430\u0437\u0443 \u0438\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0431\u043b\u043e\u043a\u043e\u0432 \u043a\u043e\u0434\u0430, \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c goto:<\/p>\n<pre><code class=\"cpp\">for( i = 0 ; i &lt; 10 ; i++ ) {     for( j = 0 ; j &lt; 10 ; j++ ) {         if( j == 3 ) goto Louter;         if( j == 4 ) goto L2;     }     L2:; } Louter:; <\/code><\/pre>\n<p>  \u0412 D \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043c\u0435\u0442\u0438\u0442\u044c \u0431\u043b\u043e\u043a \u043a\u043e\u0434\u0430 \u0438 \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u0439\u0442\u0438 \u0438\u0437 \u043d\u0435\u0433\u043e \u0441 \u043b\u044e\u0431\u043e\u0439 \u0433\u043b\u0443\u0431\u0438\u043d\u044b \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438:<\/p>\n<pre><code class=\"cpp\">Louter: for( i = 0 ; i &lt; 10 ; i++ ) {     for( j = 0 ; j &lt; 10 ; j++ ) {         if (j == 3) break Louter;         if (j == 4) continue Louter;     } } \/\/ break Louter goes here <\/code><\/pre>\n<h4>\u041f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0451\u043d \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440<\/h4>\n<p>  \u0412 C \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u043f\u0440\u044f\u0433\u0430\u0435\u0442, \u0447\u0442\u043e \u0443 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0451\u043d, \u0438\u0437-\u0437\u0430 \u0447\u0435\u0433\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043f\u0435\u0440\u0435\u0434 \u0438\u043c\u0435\u043d\u0435\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e struct. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cpp\">typedef struct ABC { ... } ABC; <\/code><\/pre>\n<p>  \u0412 D \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e struct \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0432 \u0442\u043e\u043c \u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0451\u043d, \u0447\u0442\u043e \u0438 \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f, \u0442\u0430\u043a \u0447\u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e:<\/p>\n<pre><code class=\"cpp\">struct ABC { ... } <\/code><\/pre>\n<h4>\u0412\u0435\u0442\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438)<\/h4>\n<p>  \u041d\u0430 C \u0432\u044b \u0432\u044b\u043d\u0443\u0436\u0434\u0435\u043d\u044b \u0437\u0430\u0432\u043e\u0434\u0438\u0442\u044c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u0442\u0440\u043e\u043a, \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 \u0441 \u043d\u0438\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442, \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0442\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0443 \u0432 \u043f\u043e\u0438\u0441\u043a\u0430\u0445 \u043d\u0443\u0436\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u0430 \u043f\u043e\u0442\u043e\u043c \u0434\u0435\u043b\u0430\u0442\u044c switch-case \u043f\u043e \u044d\u0442\u0438\u043c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430\u043c:<\/p>\n<pre><code class=\"cpp\">#include &lt;string.h&gt; void dostring( char *s ) {     enum Strings { Hello, Goodbye, Maybe, Max };     static char *table[] = { &quot;hello&quot;, &quot;goodbye&quot;, &quot;maybe&quot; };     int i;      for( i = 0 ; i &lt; Max ; i++ ) {         if( strcmp( s , table[i] ) == 0 ) break;     }     switch( i ) {         case Hello:   ...         case Goodbye: ...         case Maybe:   ...         default:      ...     } } <\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u044c \u044d\u0442\u0438\u0445 \u0442\u0440\u0451\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0434\u0430\u043d\u043d\u044b\u0445, \u0447\u0442\u043e \u0432\u0435\u0434\u0451\u0442 \u043a \u043e\u0448\u0438\u0431\u043a\u0430\u043c. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u0431\u043e\u0440 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u2014 \u043d\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u0435\u043d \u043f\u0440\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u0438\u0445 \u0447\u0438\u0441\u043b\u0435, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0435\u0449\u0451 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u043a\u043e\u0434, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043a\u0430\u0442\u044c \u043d\u0435 \u043b\u0438\u043d\u0435\u0439\u043d\u043e, \u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u043c \u043f\u043e\u0438\u0441\u043a\u043e\u043c \u0438\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 \u0445\u0435\u0448 \u0442\u0430\u0431\u043b\u0438\u0446\u0443.<\/p>\n<p>  D \u0436\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b switch \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0438, \u0447\u0442\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"cpp\">void dostring( string s ) {     switch( s ) {         case &quot;hello&quot;:   ...         case &quot;goodbye&quot;: ...         case &quot;maybe&quot;:   ...         default:        ...     } } <\/code><\/pre>\n<h4>\u0412\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u0435\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440<\/h4>\n<p>  \u0412 C \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u0438 \u0432\u043b\u0438\u044f\u0435\u0442 \u0441\u0440\u0430\u0437\u0443 \u043d\u0430 \u0432\u0441\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0438 \u0431\u043e\u0436\u0435 \u0443\u043f\u0430\u0441\u0438 \u0432\u0430\u0441 \u043d\u0435 \u043f\u0435\u0440\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u043c\u043e\u0434\u0443\u043b\u044c \u0438\u043b\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443. \u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b \u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 #pragma pack, \u043d\u043e \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b \u044d\u0442\u0438 \u043d\u0435 \u043f\u043e\u0440\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u044b \u0438 \u0441\u0438\u043b\u044c\u043d\u043e \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430:<\/p>\n<pre><code class=\"cpp\">#pragma pack(1) struct ABC {     ... }; #pragma pack() <\/code><\/pre>\n<p>  \u0412 D \u0435\u0441\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043a\u0430\u043a \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0442\u0435 \u0438\u043b\u0438 \u0438\u043d\u044b\u0435 \u043f\u043e\u043b\u044f (\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u043e\u043b\u044f \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0439 \u0441 C \u043c\u0430\u043d\u0435\u0440\u0435):<\/p>\n<pre><code class=\"cpp\">struct ABC {     int z;              \/\/ z is aligned to the default      align(1) int x;    \/\/ x is byte aligned     align(4) {         ...             \/\/ declarations in {} are dword aligned     }     align(2):          \/\/ switch to word alignment from here on      int y;              \/\/ y is word aligned } <\/code><\/pre>\n<h4>\u0410\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0438 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f<\/h4>\n<p>  C \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0432\u0441\u0435\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c \u0434\u0430\u0432\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u0430, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0438\u0437\u043b\u0438\u0448\u043d\u0438:<\/p>\n<pre><code class=\"cpp\">struct Foo {     int i;     union Bar {         struct Abc { int x; long y; } _abc;         char *p;     } _bar; };  #define x _bar._abc.x #define y _bar._abc.y #define p _bar.p  struct Foo f;  f.i; f.x; f.y; f.p; <\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0433\u0440\u043e\u043c\u043e\u0437\u0434\u043a\u0438\u0439, \u043d\u043e \u0438 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432 \u0434\u043b\u044f \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u044f\u0446\u0438\u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u043b\u0430\u0434\u0447\u0438\u043a \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442 \u0447\u0442\u043e \u0442\u0443\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442, \u0434\u0430 \u0435\u0449\u0451 \u0438 \u043c\u0430\u043a\u0440\u043e\u0441\u044b \u044d\u0442\u0438 \u0438\u043c\u0435\u044e\u0442 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438, \u0430 \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u044b \u043e\u0434\u043d\u043e\u0439 \u043b\u0438\u0448\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439.<\/p>\n<p>  D \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u0440\u0430\u0436\u0430\u0442\u044c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u0431\u043e\u043b\u0435\u0435 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"cpp\">struct Foo {     int i;     union {         struct { int x; long y; }         char* p;     } }  Foo f;  f.i; f.x; f.y; f.p; <\/code><\/pre>\n<h4>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445<\/h4>\n<p>  \u041d\u0430 C \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043e\u0434\u043d\u0438\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c:<\/p>\n<pre><code class=\"cpp\">struct Foo { int x; int y; } foo; <\/code><\/pre>\n<p>  \u0418\u043b\u0438 \u043f\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438:<\/p>\n<pre><code class=\"cpp\">struct Foo { int x; int y; };   \/\/ note terminating ; struct Foo foo; <\/code><\/pre>\n<p>  \u0412 D \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"cpp\">struct Foo { int x; int y; }    \/\/ note there is no terminating ; Foo foo; <\/code><\/pre>\n<h4>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b<\/h4>\n<p>  \u0412 C, \u043e\u043f\u044f\u0442\u044c \u0436\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043c\u0430\u043a\u0440\u043e\u0441\u044b:<\/p>\n<pre><code class=\"cpp\">#include &lt;stddef&gt; struct Foo { int x; int y; };  off = offsetof( Foo , y ); <\/code><\/pre>\n<p>  \u0412 D \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u0435\u0441\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e:<\/p>\n<pre><code class=\"cpp\">struct Foo { int x; int y; }  off = Foo.y.offsetof; <\/code><\/pre>\n<h4>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439<\/h4>\n<p>  \u0412 C \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0432\u043e\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0435\u0435 \u043f\u043e \u0442\u0438\u043f\u0443 \u043f\u043e\u043b\u0435, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043a \u0441\u043a\u0440\u044b\u0442\u044b\u043c \u0431\u0430\u0433\u0430\u043c \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0438\u0445 \u0441\u043e\u0441\u0442\u0430\u0432\u0430 \u0438 \u043f\u043e\u0440\u044f\u0434\u043a\u0430:<\/p>\n<pre><code class=\"cpp\">union U { int a; long b; }; union U x = { 5 };                \/\/ initialize member 'a' to 5 <\/code><\/pre>\n<p>  \u0412 D \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u043c\u0443 \u043f\u043e\u043b\u044e \u0432\u044b \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"cpp\">union U { int a; long b; } U x = { a : 5 }; <\/code><\/pre>\n<h4>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440<\/h4>\n<p>  \u0412 C \u043f\u043e\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0438\u0445 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u0434\u043b\u044f \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440, \u043d\u043e \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0439 \u0433\u043e\u043b\u043e\u0432\u043d\u043e\u0439 \u0431\u043e\u043b\u044c\u044e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0431\u043e\u043b\u044c\u0448\u0438\u0445, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0441\u043e\u0441\u0442\u0430\u0432 \u043f\u043e\u043b\u0435\u0439:<\/p>\n<pre><code class=\"cpp\">struct S { int a; int b; int d; int d; }; struct S x = { 5 , 3 , 2 , 10 }; <\/code><\/pre>\n<p>  \u0412 D \u0432\u044b \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u044f \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443, \u043d\u043e \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0451 \u0436\u0435 \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u043f\u043e\u043b\u0435\u0439:<\/p>\n<pre><code class=\"cpp\">struct S { int a; int b; } S x = { b : 3 , a : 5 }; <\/code><\/pre>\n<h4>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432<\/h4>\n<p>  \u0412 C \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443 \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432:<\/p>\n<pre><code class=\"cpp\">int a[3] = { 3 , 2 , 2 }; <\/code><\/pre>\n<p>  \u0412\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0432 C \u043c\u043e\u0433\u0443\u0442 \u043d\u0435 \u043e\u043a\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u043c\u0438 \u0441\u043a\u043e\u0431\u043a\u0430\u043c\u0438:<\/p>\n<pre><code class=\"cpp\">int b[3][2] = { 2,3 , { 6 , 5 } , 3,4 }; <\/code><\/pre>\n<p>  \u0412 D, \u0440\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0442\u0430\u043a\u0436\u0435 \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443, \u043d\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438 \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442 \u043a \u043e\u0434\u043d\u043e\u043c\u0443 \u0438 \u0442\u043e\u043c\u0443 \u0436\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0443:<\/p>\n<pre><code class=\"cpp\">int[3] a = [ 3, 2, 0 ]; int[3] a = [ 3, 2 ];            \/\/ unsupplied initializers are 0, just like in C int[3] a = [ 2 : 0, 0 : 3, 1 : 2 ]; int[3] a = [ 2 : 0, 0 : 3, 2 ];     \/\/ if not supplied, the index is the previous one plus one. <\/code><\/pre>\n<p>  \u042f\u0432\u043d\u043e\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e, \u043a\u043e\u0433\u0434\u0430 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u043c\u0435\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u043a\u0430\u043a\u043e\u0433\u043e-\u043b\u0438\u0431\u043e \u043d\u0430\u0431\u043e\u0440\u0430:<\/p>\n<pre><code class=\"cpp\">enum color { black, red, green } int[3] c = [ black : 3, green : 2, red : 5 ]; <\/code><\/pre>\n<p>  \u0421\u043a\u043e\u0431\u043a\u0438 \u0434\u043b\u044f \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b:<\/p>\n<pre><code class=\"cpp\">int[2][3] b = [ [ 2 , 3 ] , [ 6 , 5 ] , [ 3 , 4 ] ];  int[2][3] b = [ [ 2 , 6 , 3 ] , [ 3 , 5 , 4 ] ];            \/\/ error <\/code><\/pre>\n<h4>\u042d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043f\u0435\u0446\u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432 \u0441\u0442\u0440\u043e\u043a\u0430\u0445<\/h4>\n<p>  \u0412 C \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u043a\u043e\u0441\u043e\u0439 \u0447\u0435\u0440\u0442\u044b, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043d\u0430\u0447\u0430\u043b\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c:<\/p>\n<pre><code class=\"cpp\">char file[] = &quot;c:\\\\root\\\\file.c&quot;; \/\/ c:\\root\\file.c char quoteString[] = &quot;\\&quot;[^\\\\\\\\]*(\\\\\\\\.[^\\\\\\\\]*)*\\&quot;&quot;; \/\/ \/&quot;[^\\\\]*(\\\\.[^\\\\]*)*&quot;\/ <\/code><\/pre>\n<p>  \u0412 D \u0432 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u0441\u0442\u0440\u043e\u043a\u0430\u043c \u0441 \u044d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0432 \u0441\u0442\u0438\u043b\u0435 C, \u0435\u0441\u0442\u044c \u0438 \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u00ab\u0441\u044b\u0440\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438\u00bb, \u0433\u0434\u0435 \u044d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0438 \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0435 \u0440\u043e\u0432\u043d\u043e \u0442\u043e, \u0447\u0442\u043e \u0432\u0432\u0435\u043b\u0438:<\/p>\n<pre><code class=\"cpp\">string file = r&quot;c:\\root\\file.c&quot;;  \/\/ c:\\root\\file.c string quotedString = `&quot;[^\\\\]*(\\\\.[^\\\\]*)*&quot;`;  \/\/ &quot;[^\\\\]*(\\\\.[^\\\\]*)*&quot; <\/code><\/pre>\n<h4>ASCII \u043f\u0440\u043e\u0442\u0438\u0432 \u043c\u043d\u043e\u0433\u043e\u0431\u0430\u0439\u0442\u043d\u044b\u0445 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043e\u043a<\/h4>\n<p>  \u0412 C \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0442\u0438\u043f \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 wchar_t \u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0435\u0444\u0438\u043a\u0441 L \u0443 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0445 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442:<\/p>\n<pre><code class=\"cpp\">#include &lt;wchar.h&gt; char foo_ascii[] = &quot;hello&quot;; wchar_t foo_wchar[] = L&quot;hello&quot;; <\/code><\/pre>\n<p>  \u041d\u043e \u0438\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0433\u043e \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u0447\u0442\u043e \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043c\u0430\u043a\u0440\u043e\u0441\u0430\u043c\u0438, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u043c\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"cpp\">#include &lt;tchar.h&gt; tchar string[] = TEXT( &quot;hello&quot; ); <\/code><\/pre>\n<p>  \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 D \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0442\u0438\u043f\u044b \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442 \u0438\u0437 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u0441\u043d\u0438\u043c\u0430\u044f \u0441 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 \u0431\u0440\u0435\u043c\u044f \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0442\u0438\u043f\u044b \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432\u0440\u0443\u0447\u043d\u0443\u044e:<\/p>\n<pre><code class=\"cpp\">string  utf8  = &quot;hello&quot;;     \/\/ UTF-8 string wstring utf16 = &quot;hello&quot;;     \/\/ UTF-16 string dstring utf32 = &quot;hello&quot;;     \/\/ UTF-32 string <\/code><\/pre>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e, \u0435\u0441\u0442\u044c \u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0443\u0444\u0444\u0438\u043a\u0441\u044b, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0435 \u0442\u0438\u043f \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0445 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442:<\/p>\n<pre><code class=\"cpp\">auto str    = &quot;hello&quot;;       \/\/ UTF-8 string auto _utf8  = &quot;hello&quot;c;      \/\/ UTF-8 string auto _utf16 = &quot;hello&quot;w;      \/\/ UTF-16 string auto _utf32 = &quot;hello&quot;d;      \/\/ UTF-32 string <\/code><\/pre>\n<h4>\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u043c\u0430\u0441\u0441\u0438\u0432<\/h4>\n<p>  \u0412 C \u0432\u044b \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435, \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043c\u0430\u0441\u0441\u0438\u0432, \u0447\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u0447\u0438\u0441\u043b\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0440\u0430\u0437\u0440\u0430\u0441\u0442\u0430\u0435\u0442\u0441\u044f:<\/p>\n<pre><code class=\"cpp\">enum COLORS { red , blue , green , max }; char *cstring[ max ] = { &quot;red&quot; , &quot;blue&quot; , &quot;green&quot; }; <\/code><\/pre>\n<p>  \u0412 D \u0442\u0430\u043a\u043e\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0451\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0438 \u043a\u043b\u044e\u0447-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u0440\u043e\u0449\u0435 \u0432 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0435:<\/p>\n<pre><code class=\"cpp\">enum COLORS { red, blue, green }  string[ COLORS.max + 1 ] cstring = [     COLORS.red : &quot;red&quot;,     COLORS.blue : &quot;blue&quot;,     COLORS.green : &quot;green&quot;, ]; <\/code><\/pre>\n<h4>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u0442\u0438\u043f\u043e\u0432<\/h4>\n<p>  \u0412 C \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 typedef \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043d\u0435 \u043d\u043e\u0432\u044b\u0439 \u0442\u0438\u043f, \u0430 \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043f\u0441\u0435\u0432\u0434\u043e\u043d\u0438\u043c:<\/p>\n<pre><code class=\"cpp\">typedef void *Handle; void foo( void * ); void bar( Handle );  Handle h; foo( h ); \/\/ coding bug not caught bar( h ); \/\/ ok <\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u044d\u0442\u043e\u043c, \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u043a\u0440\u043e\u0441\u044b:<\/p>\n<pre><code class=\"cpp\">#define HANDLE_INIT ( (Handle) -1 )  Handle h = HANDLE_INIT; h = func(); if( h != HANDLE_INIT ) {     ... } <\/code><\/pre>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0432 C \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0442\u0438\u043f, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043a\u0430\u043a \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0442\u0438\u043f\u043e\u0432, \u0442\u0430\u043a \u0438 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443: <\/p>\n<pre><code class=\"cpp\">struct Handle__ { void *value; } typedef struct Handle__ *Handle; void foo( void * ); void bar( Handle );  Handle h; foo( h ); \/\/ syntax error bar( h ); \/\/ ok <\/code><\/pre>\n<p>  \u0410 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u0447\u0451\u0440\u043d\u0443\u044e \u043c\u0430\u0433\u0438\u044e:<\/p>\n<pre><code class=\"cpp\">struct Handle__ HANDLE_INIT;  \/\/ call this function upon startup void init_handle() {     HANDLE_INIT.value = (void *)-1; }  Handle h = HANDLE_INIT; h = func(); if( memcmp( &h , &HANDLE_INIT , sizeof( Handle ) ) != 0 ) {     ... } <\/code><\/pre>\n<p>  D \u0436\u0435 \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u043c\u043e\u0449\u043d\u044b\u043c\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u043c\u0435\u0442\u0430\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c typedef \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0438\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438:<\/p>\n<pre><code class=\"cpp\">import std.typecons;  alias Handle = Typedef!( void* ); void foo( void* ); void bar( Handle );  Handle h; foo( h ); \/\/ syntax error bar( h ); \/\/ ok <\/code><\/pre>\n<p>  \u0412\u0442\u043e\u0440\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u0430 Typedef \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0438 \u043f\u043e\u043f\u0430\u0434\u0451\u0442 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0432\u0441\u0435\u0445 \u0442\u0438\u043f\u043e\u0432 \u2014 init:<\/p>\n<pre><code class=\"cpp\">alias Handle = Typedef!( void* , cast( void* ) -1 ); Handle h; h = func(); if( h != Handle.init ) {     ... } <\/code><\/pre>\n<h4>\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440<\/h4>\n<p>  \u041d\u0430 C \u043d\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0434\u0432\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u043e\u0432 \u043f\u0430\u043c\u044f\u0442\u0438:<\/p>\n<pre><code class=\"cpp\">#include &lt;string.h&gt;  struct A x , y; ... if( memcmp( &x , &y , sizeof( struct A ) ) == 0 ) {     ... } <\/code><\/pre>\n<p>  \u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0442\u0438\u043f\u043e\u0432 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0441\u0430\u043c\u043e\u0439 \u0441\u0435\u0440\u044c\u0451\u0437\u043d\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u043e\u043b\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432\u044b\u0440\u043e\u0432\u043d\u0435\u043d\u043d\u044b\u043c\u0438 \u043f\u043e \u0433\u0440\u0430\u043d\u0438\u0446\u0430\u043c \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 \u0438\u0437 \u0441\u043e\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043d\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 C \u043d\u0435 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u0432 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043a\u0430\u0445 \u043c\u0435\u0436\u0434\u0443 \u043f\u043e\u043b\u044f\u043c\u0438 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043c\u0443\u0441\u043e\u0440\u0430, \u043e\u0441\u0442\u0430\u0432\u0448\u0435\u0433\u043e\u0441\u044f \u043e\u0442 \u0440\u0430\u043d\u0435\u0435 \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u0445\u0441\u044f \u0432 \u0442\u043e\u043c \u0436\u0435 \u043c\u0435\u0441\u0442\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u0431\u044b \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u0440\u0438\u0437\u043d\u0430\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438.<\/p>\n<p>  \u0412 D \u0432\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043e\u0431\u043e \u0432\u0441\u0451\u043c \u043f\u043e\u0437\u0430\u0431\u043e\u0442\u0438\u0442\u0441\u044f:<\/p>\n<pre><code class=\"cpp\">A x , y; ... if( x == y ) {     ... } <\/code><\/pre>\n<h4>\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a<\/h4>\n<p>  \u0412 C \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442 \u0431\u0430\u0439\u0442\u044b \u0434\u043e \u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e \u0431\u0430\u0439\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n<pre><code class=\"cpp\">char str[] = &quot;hello&quot;;  if( strcmp( str , &quot;betty&quot; ) == 0 ) {  \/\/ do strings match?     ... } <\/code><\/pre>\n<p>  \u0412 D \u0436\u0435 \u0432\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"cpp\">string str = &quot;hello&quot;;  if( str == &quot;betty&quot; ) {     ... } <\/code><\/pre>\n<p>  \u0421\u0442\u0440\u043e\u043a\u0430 \u0432 D \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u043f\u0435\u0440\u0435\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0430 \u0435\u0433\u043e \u0434\u043b\u0438\u043d\u0430, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0438 \u0441 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c\u044e, \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u043e\u0432 \u043f\u0430\u043c\u044f\u0442\u0438. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e D \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u0432 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0438 \u0441\u0442\u0440\u043e\u043a:<\/p>\n<pre><code class=\"cpp\">string str = &quot;hello&quot;;  if( str &lt; &quot;betty&quot; ) {     ... } <\/code><\/pre>\n<h4>\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432<\/h4>\n<p>  \u0425\u043e\u0442\u044c \u043c\u043d\u043e\u0433\u0438\u0435 C \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b \u0438 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u044f\u0442 \u0438\u0437 \u0440\u0430\u0437\u0430 \u0432 \u0440\u0430\u0437 \u043f\u0443\u0437\u044b\u0440\u044c\u043a\u043e\u0432\u044b\u0435 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438, \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u2014 \u044d\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e qsort():<\/p>\n<pre><code class=\"cpp\">int compare( const void *p1 , const void *p2 ) {     type *t1 = (type *) p1;     type *t2 = (type *) p2;      return *t1 - *t2; }  type array[10]; ... qsort( array , sizeof( array ) \/ sizeof( array[0] ), sizeof( array[0] ), compare ); <\/code><\/pre>\n<p>  \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0444\u0443\u043d\u043a\u0446\u0438\u044f compare() \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0430 \u044f\u0432\u043d\u043e \u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u043c \u0442\u0438\u043f\u0430\u043c.<\/p>\n<p>  D \u0438\u043c\u0435\u0435\u0442 \u043c\u043e\u0449\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0443\u044e \u043a\u0430\u043a \u0441\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c\u0438, \u0442\u0430\u043a \u0438 \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438:<\/p>\n<pre><code class=\"cpp\">import std.algorithm; type[] array; ... sort( array ); \/\/ sort array in-place array.sort!&quot;a&gt;b&quot; \/\/ using custom compare function array.sort!( ( a , b ) =&gt; ( a &gt; b ) )  \/\/ same as above <\/code><\/pre>\n<h4>\u0421\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0435 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u044b<\/h4>\n<p>  C \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b, \u043e\u0434\u043d\u0430\u043a\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0438\u0445 \u043f\u043e\u0434\u043e\u0431\u0438\u044f:<\/p>\n<pre><code class=\"cpp\">&quot;This text \\&quot;spans\\&quot;\\n\\ multiple\\n\\ lines\\n&quot; <\/code><\/pre>\n<p>  \u0412 D \u044d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043b\u0438\u0448\u044c \u043a\u0430\u0432\u044b\u0447\u043a\u0438, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043a\u0430\u043a \u0435\u0441\u0442\u044c:<\/p>\n<pre><code class=\"cpp\">&quot;This text \\&quot;spans\\&quot; multiple lines &quot; <\/code><\/pre>\n<p>  <\/p>\n<h4>\u041e\u0431\u0445\u043e\u0434 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0434\u0430\u043d\u043d\u044b\u0445<\/h4>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u043e\u0438\u0441\u043a\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u043c \u0434\u0435\u0440\u0435\u0432\u0435. \u0412 C \u043c\u044b \u0432\u044b\u043d\u0443\u0436\u0434\u0435\u043d\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e membersearchx, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e\u0431\u0445\u043e\u0434\u0430 \u0434\u0435\u0440\u0435\u0432\u0430. \u0427\u0442\u043e\u0431\u044b \u043e\u043d\u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0445\u043e\u0434\u0438\u043b\u0430, \u043d\u043e \u0438 \u0434\u0435\u043b\u0430\u043b\u0430 \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0435 \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u0435\u0439 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0432 \u0432\u0438\u0434\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b Paramblock:<\/p>\n<pre><code class=\"cpp\">struct Symbol {     char *id;     struct Symbol *left;     struct Symbol *right; };  struct Paramblock {     char *id;     struct Symbol *sm; };  static void membersearchx( struct Paramblock *p , struct Symbol *s ) {     while( s ) {         if( strcmp( p-&gt;id , s-&gt;id ) == 0 ) {             if( p-&gt;sm ) error( &quot;ambiguous member %s\\n&quot; , p-&gt;id );             p-&gt;sm = s;         }          if( s-&gt;left ) {             membersearchx(p,s-&gt;left);         }         s = s-&gt;right;     } }  struct Symbol *symbol_membersearch( Symbol *table[] , int tablemax , char *id ) {     struct Paramblock pb;     int i;      pb.id = id;     pb.sm = NULL;     for( i = 0 ; i &lt; tablemax ; i++ ) {         membersearchx( pb , table[i] );     }     return pb.sm; } <\/code><\/pre>\n<p>  \u0412 D \u0432\u0441\u0451 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u0440\u043e\u0449\u0435 \u2014 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432\u043d\u0443\u0442\u0440\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c\u043e\u0439, \u0438 \u043f\u0435\u0440\u0432\u0430\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u0432\u0442\u043e\u0440\u043e\u0439, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0440\u043e\u043a\u0438\u0434\u044b\u0432\u0430\u0442\u044c \u0432 \u043d\u0435\u0451 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0447\u0435\u0440\u0435\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:<\/p>\n<pre><code class=\"cpp\">class Symbol {     char[] id;     Symbol left;     Symbol right; }  Symbol symbol_membersearch( Symbol[] table , char[] id ) {     Symbol sm;      void membersearchx( Symbol s ) {         while( s ) {             if( id == s.id ) {                 if( sm ) error( &quot;ambiguous member %s\\n&quot; , id );                 sm = s;             }              if( s.left ) {                 membersearchx(s.left);             }             s = s.right;         }     }      for( int i = 0 ; i &lt; table.length ; i++ ) {         membersearchx( table[i] );     }      return sm; } <\/code><\/pre>\n<h4>\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u044f<\/h4>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043d\u044b\u0439 \u0442\u0438\u043f. \u0427\u0442\u043e\u0431\u044b \u0431\u044b\u0442\u044c \u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u043c, \u0435\u043c\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043c\u0435\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0439 \u043a\u043e\u0434 \u043a \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443. \u0412 C \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430. \u0412 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0435\u0439 \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0441 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0449\u0443\u044e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0447\u0438\u0441\u0435\u043b \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430:<\/p>\n<pre><code class=\"cpp\">void apply( void *p , int *array , int dim , void (*fp) ( void* , int ) ) {     for( int i = 0 ; i &lt; dim ; i++ ) {         fp( p , array[i] );     } }  struct Collection {     int array[10]; };  void comp_max( void *p , int i ) {     int *pmax = (int *) p;      if( i &gt; *pmax ) {         *pmax = i;     } }  void func( struct Collection *c ) {     int max = INT_MIN;      apply( &max , c-&gt;array , sizeof( c-&gt;array ) \/ sizeof( c-&gt;array[0] ) , comp_max ); } <\/code><\/pre>\n<p>  \u0412 D \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439 \u0434\u0435\u043b\u0435\u0433\u0430\u0442 \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u0443\u044e \u043a \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0443. \u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0435 \u043a\u0443\u0434\u0430-\u043b\u0438\u0431\u043e \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043d\u0430 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0430, \u0442\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u0434\u0435\u043b\u0435\u0433\u0430\u0442.<\/p>\n<pre><code class=\"cpp\">class Collection {     int[10] array;      void apply( void delegate( int ) fp ) {         for( int i = 0 ; i &lt; array.length ; i++ ) {             fp( array[i] );         }     } }  void func( Collection c ) {     int max = int.min;      void comp_max( int i ) {         if( i &gt; max ) max = i;     }      c.apply( &comp_max ); } <\/code><\/pre>\n<p>  \u0418\u043b\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043f\u043e \u043f\u0440\u043e\u0449\u0435, \u0441 \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u043c \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u043e\u043c:<\/p>\n<pre><code class=\"cpp\">void func( Collection c ) {     int max = int.min;      c.apply( ( int i ) {         if( i &gt; max ) max = i;     } ); } <\/code><\/pre>\n<h4>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432<\/h4>\n<p>  \u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u043a \u043d\u0430 C \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0441\u0443\u043c\u043c\u0438\u0440\u0443\u044e\u0449\u0443\u044e \u0432\u0441\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0435 \u0435\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u044b \u0438\u0445 \u043d\u0438 \u0431\u044b\u043b\u043e:<\/p>\n<pre><code class=\"cpp\">#include &lt;stdio.h&gt; #include &lt;stdarg.h&gt;  int sum( int dim , ... ) {     int i;     int s = 0;     va_list ap;      va_start( ap , dim );     for( i = 0 ; i &lt; dim ; i++) {         s += va_arg( ap , int );     }     va_end( ap );     return s; }  int main() {     int i;      i = sum(3, 8 , 7 , 6 );     printf( &quot;sum = %d\\n&quot; , i );      return 0; } <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u043c, \u043d\u0430\u043c \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0447\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430, \u043d\u043e \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u0442\u0440\u0443\u0434\u043d\u043e\u0443\u043b\u043e\u0432\u0438\u043c\u044b\u0445 \u0431\u0430\u0433\u043e\u0432. \u041d\u0443 \u0438 \u043a\u0443\u0434\u0430 \u0436\u0435 \u0431\u0435\u0437 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u2014 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0445 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0442\u0438\u043f\u043e\u0432 \u043b\u0435\u0436\u0438\u0442 \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0430 \u0441\u043e\u0432\u0435\u0441\u0442\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430.<\/p>\n<p>  \u0412 D \u0436\u0435 \u0435\u0441\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f &quot;&#8230;&quot; \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0430\u044f \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430:<\/p>\n<pre><code class=\"cpp\">import std.stdio;  int sum( int[] values ... ) {     int s = 0;      foreach( int x ; values ) {         s += x;     }     return s; }  int main() {     int i = sum( 8 , 7 , 6 );          writefln( &quot;sum = %d&quot;, i );      return 0; } <\/code><\/pre>\n<p>  \u0418 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432:<\/p>\n<pre><code class=\"cpp\">int main() { \tint[] ints = [ 8 , 7 , 6 ];      int i = sum( ints );      writefln( &quot;sum = %d&quot;, i );      return 0; } <\/code><\/pre>\n<h4>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u044f\u0437\u044b\u043a\u0430 D, \u0432\u043e \u043c\u043d\u043e\u0433\u043e\u043c \u044f\u0432\u043b\u044f\u044e\u0449\u0438\u0435\u0441\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u044d\u0432\u043e\u043b\u044e\u0446\u0438\u043e\u043d\u043d\u044b\u043c \u0448\u0430\u0433\u043e\u043c \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u044f\u0437\u044b\u043a\u0430 C. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u043e\u043f\u0440\u043e\u0441 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u0441 \u0431\u043e\u043b\u0435\u0435 \u043c\u043e\u0449\u043d\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 C++ \u0438 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e Go. \u041e\u0441\u0442\u0430\u0432\u0430\u0439\u0442\u0435\u0441\u044c \u043d\u0430 \u0441\u0432\u044f\u0437\u0438.         \t<\/p>\n<div class=\"polling\">\n<form action=\"\/json\/polling\/\" class=\"poll\" method=\"post\">\n<div class=\"poll_title\">\u041d\u0443 \u0447\u0442\u043e, \u043d\u0430 \u043a\u0430\u043a\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u044f\u0437\u044b\u043a \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c?<\/div>\n<p>  \t\t<input type=\"hidden\" name=\"post_id\" value=\"276227\"\/> \t\t<input type=\"hidden\" name=\"polling_question_id\" value=\"14531\"\/>  \t\t<\/p>\n<table class=\"answer\">\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv71087\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"71087\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv71087\">C<\/label> \t\t\t\t<\/td>\n<\/tr>\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv71089\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"71089\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv71089\">C++<\/label> \t\t\t\t<\/td>\n<\/tr>\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv71091\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"71091\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv71091\">D<\/label> \t\t\t\t<\/td>\n<\/tr>\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv71093\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"71093\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv71093\">Go<\/label> \t\t\t\t<\/td>\n<\/tr>\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv71095\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"71095\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv71095\">Rust<\/label> \t\t\t\t<\/td>\n<\/tr>\n<\/table>\n<p class=\"total\">\u041f\u0440\u043e\u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043b 1 \u0447\u0435\u043b\u043e\u0432\u0435\u043a. \u0412\u043e\u0437\u0434\u0435\u0440\u0436\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u043d\u0435\u0442.<\/p>\n<\/p><\/form>\n<p class=\"for_users_only_msg\">\u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u043f\u0440\u043e\u0441\u0435. <a href=\"https:\/\/habrahabr.ru\/auth\/login\/\">\u0412\u043e\u0439\u0434\u0438\u0442\u0435<\/a>, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430.<\/p>\n<\/p><\/div>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/276227\/\"> https:\/\/habrahabr.ru\/post\/276227\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u041a\u0430\u0436\u0434\u044b\u0439 \u0421-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u0441 \u043e\u043f\u044b\u0442\u043e\u043c \u043d\u0430\u043a\u0430\u043f\u043b\u0438\u0432\u0430\u0435\u0442 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0439 \u0431\u0430\u0433\u0430\u0436 \u0442\u0435\u0445\u043d\u0438\u043a \u0438 \u0438\u0434\u0438\u043e\u043c. \u0417\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u0431\u044b\u0432\u0430\u0435\u0442 \u0441\u043b\u043e\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0432 \u043d\u043e\u0432\u043e\u043c \u044f\u0437\u044b\u043a\u0435. \u0422\u0430\u043a \u0432\u043e\u0442, \u0432\u0430\u0448\u0435\u043c\u0443 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0445 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432 \u043d\u0430 C \u0438 \u0438\u0445 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 D. \u0415\u0441\u043b\u0438 \u0432\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0435\u0441\u044c \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u0441\u0432\u043e\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0441 C \u043d\u0430 D \u0438\u043b\u0438 \u0435\u0449\u0451 \u0441\u043e\u043c\u043d\u0435\u0432\u0430\u0435\u0442\u0435\u0441\u044c \u0441\u0442\u043e\u0438\u0442 \u043b\u0438 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u0442\u043e \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0434\u043b\u044f \u0432\u0430\u0441.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-273260","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/273260","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=273260"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/273260\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=273260"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=273260"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=273260"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}