Changeset d3a49864 for doc/theses/mike_brooks_MMath/programs
- Timestamp:
- Apr 8, 2024, 11:56:19 AM (12 months ago)
- Branches:
- master
- Children:
- cb98d9d
- Parents:
- 2d82999
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified doc/theses/mike_brooks_MMath/programs/bkgd-carray-arrty.c ¶
r2d82999 rd3a49864 57 57 f( &ar ); 58 58 59 float fs[] = {3.14, 1.7 07};59 float fs[] = {3.14, 1.77}; 60 60 char cs[] = "hello"; 61 61 static_assert( sizeof(fs) == 2 * sizeof(float) ); 62 62 static_assert( sizeof(cs) == 6 * sizeof(char) ); $\C{// 5 letters + 1 null terminator}$ 63 63 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" }; 66 static_assert( sizeof(fm) == 3 * 2 * sizeof(float) ); 67 static_assert( sizeof(cm) == 3 * 6 * sizeof(char) ); 64 68 } 65 69
Note: See TracChangeset
for help on using the changeset viewer.