Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!bcm!rice!uupsi!sunic!chalmers.se!etek.chalmers.se!fy.chalmers.se!f90angu From: f90angu@fy.chalmers.se (Andreas Gunnarsson) Newsgroups: comp.lang.c Subject: Initializing a pointer inside a struct Message-ID: <1991Apr17.105139.16331@fy.chalmers.se> Date: 17 Apr 91 10:51:39 GMT Organization: Chalmers University of Technology, G|teborg, Sweden Lines: 30 I've tried this: struct { ... int *int_list; ... } list_of_structs[] = { { ..., {1, 2, 3, -1}, ...}, { ..., {4, -1}, ...}, . . . }; It doesn't work. I know I could declare the lists of integers as separate variables and use the address, but it would be much harder to see what data belongs where, and I would have to use *lots* of variable names. I could also write 'int int_list[MAX];' instead of 'int *int_list;', but in that case lots of space would be wasted if there is big variance in length. Is there any simple way to do it? -- ============================================================================== 73 es 88 de SM7TLS f90angu@fy.chalmers.se Andreas Gunnarsson ==============================================================================