Changes in src/tests/designations.c [a04ce4d:62423350]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/designations.c
ra04ce4d r62423350 9 9 // Author : Rob Schluntz 10 10 // Created On : Thu Jun 29 15:26:36 2017 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Thu Ju l 27 11:46:35 201713 // Update Count : 311 // Last Modified By : Rob Schluntz 12 // Last Modified On : Thu Jun 29 15:27:05 2017 13 // Update Count : 2 14 14 // 15 15 … … 89 89 }; 90 90 91 struct Fred {92 double i[3];93 int j;94 struct Mary {95 struct Jane {96 double j;97 } j;98 double i;99 } m;100 };101 struct Fred s1 @= { .m.j : 3 };102 struct Fred s2 @= { .i : { [2] : 2 } };103 104 91 int main() { 105 92 // simple designation case - starting from beginning of structure, leaves ptr default-initialized (zero) … … 212 199 }; 213 200 #endif 214 // array designation 215 int i[2] = { [1] : 3 }; 201 216 202 // allowed to have 'too many' initialized lists - essentially they are ignored. 217 203 int i1 = { 3 }; … … 254 240 const char * str0 = "hello"; 255 241 char str1[] = "hello"; 256 const char c1[] = "abc";257 const char c2[] = { 'a', 'b', 'c' };258 const char c3[][2] = { { 'a', 'b' }, { 'c', 'd'}, { 'c', 'd'} };259 242 } 260 243
Note:
See TracChangeset
for help on using the changeset viewer.