digitalmars.D - array of structures?
- aelmetwaly (16/16) Sep 14 2004 Hi there,
- Stewart Gordon (13/20) Sep 14 2004 You've got your {} and [] backwards?
- Sha Chancellor (5/26) Sep 20 2004 I find this whole usage of [ ]'s as part of initializers to be
- LiuXuHong (1/1) Oct 29 2004 I encountered this problem too. how to solve?
- Stewart Gordon (3/4) Oct 29 2004 With the same solution that was posted in reply to the original.
Hi there, I want to code an array of strcucts and initialize it like this <code> struct person { char[] name; int id; } person[] persons = { [ "Person" , 1 ] ... } but the compiler give the following error a struct is not a valid initializer of person[] how can i solve this.
Sep 14 2004
aelmetwaly wrote:Hi there, I want to code an array of strcucts and initialize it like this<snip>but the compiler give the following error a struct is not a valid initializer of person[] how can i solve this.You've got your {} and [] backwards? Should be person[] persons = [ { "Person" , 1 } ... ]; Stewart. -- My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
Sep 14 2004
In article <ci6ugd$2t1i$1 digitaldaemon.com>, Stewart Gordon <smjg_1998 yahoo.com> wrote:aelmetwaly wrote:I find this whole usage of [ ]'s as part of initializers to be confusing. Why is it different from C again? For those of us who missed the discussion before.Hi there, I want to code an array of strcucts and initialize it like this<snip>but the compiler give the following error a struct is not a valid initializer of person[] how can i solve this.You've got your {} and [] backwards? Should be person[] persons = [ { "Person" , 1 } ... ]; Stewart.
Sep 20 2004
I encountered this problem too. how to solve?
Oct 29 2004
LiuXuHong wrote:I encountered this problem too. how to solve?With the same solution that was posted in reply to the original. Stewart.
Oct 29 2004