Ignore:
Timestamp:
Oct 26, 2024, 6:48:38 PM (3 weeks ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
bf91d1d
Parents:
06d75931
Message:

proofread introduction chapter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/mike_brooks_MMath/programs/bkgd-carray-arrty.c

    r06d75931 r14c31eb  
    5757        f( &ar );
    5858
    59         float fs[] = {3.14, 1.77};
    60         char cs[] = "hello";
     59        float fs@[]@ = {3.14, 1.77};
     60        char cs@[]@ = "hello";    // shorthand for 'h', 'e', 'l', 'l', 'o', '\0'
    6161        static_assert( sizeof(fs) == 2 * sizeof(float) );
    6262        static_assert( sizeof(cs) == 6 * sizeof(char) );  $\C{// 5 letters + 1 null terminator}$
    6363
    64         float fm[][2] = { {3.14, 1.77}, {12.4, 0.01}, {7.8, 1.23} };  $\C{// brackets define structuring}$
    65         char cm[][sizeof("hello")] = { "hello", "hello", "hello" };
     64        float fm[]@[2]@ = { {3.14, 1.77}, {12.4, 0.01}, {7.8, 1.23} };  $\C{// brackets define structuring}$
     65        char cm[]@[sizeof("hello")]@ = { "hello", "hello", "hello" };
    6666        static_assert( sizeof(fm) == 3 * 2 * sizeof(float) );
    6767        static_assert( sizeof(cm) == 3 * 6 * sizeof(char) );
Note: See TracChangeset for help on using the changeset viewer.