Changeset 33474e6 for doc/theses/mike_brooks_MMath/programs
- Timestamp:
- Oct 28, 2024, 11:31:39 AM (3 months ago)
- Branches:
- master
- Children:
- d0296db6
- Parents:
- 720eec9 (diff), bf91d1d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/mike_brooks_MMath/programs/bkgd-carray-arrty.c
r720eec9 r33474e6 57 57 f( &ar ); 58 58 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' 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" };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 66 static_assert( sizeof(fm) == 3 * 2 * sizeof(float) ); 67 67 static_assert( sizeof(cm) == 3 * 6 * sizeof(char) );
Note: See TracChangeset
for help on using the changeset viewer.