Mercurial > projects > dstress
view run/struct_initialization_06.d @ 307:86e4b19bc26b
array init
Andrew Fedoniouk <news@terrainformatica.com>
2005-03-10
news:d0otkq$1fsg$1@digitaldaemon.com
nntp://news.digitalmars.com/digitalmars.D.bugs/3137
author | thomask |
---|---|
date | Mon, 14 Mar 2005 07:06:21 +0000 |
parents | |
children | 7e8e5013a030 |
line wrap: on
line source
// $HeadURL$ // $Date$ // $Author$ // @author@ Andrew Fedoniouk <news@terrainformatica.com> // @date@ 2005-03-10 // @uri@ news:d0otkq$1fsg$1@digitaldaemon.com // @url@ nntp://news.digitalmars.com/digitalmars.D.bugs/3137 module dstress.run.struct_initialization_06; struct A { int one; int two[4]; } A a = { one:1, two:2 }; int main(){ assert(a.one==1); assert(a.two[0]==2); assert(a.two[1]==2); assert(a.two[2]==2); assert(a.two[3]==2); return 0; }