Mercurial > projects > dstress
changeset 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 | 1a91b18b3260 |
children | 1dcc48f613dc |
files | run/struct_initialization_06.d |
diffstat | 1 files changed, 26 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/struct_initialization_06.d Mon Mar 14 07:06:21 2005 +0000 @@ -0,0 +1,26 @@ +// $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; +}