Path: utzoo!censor!becker!geac!jtsv16!uunet!ficc!peter From: peter@ficc.uu.net (Peter da Silva) Newsgroups: comp.std.c Subject: Re: C question (memory allocation and access) Keywords: memory access Message-ID: <7008@ficc.uu.net> Date: 16 Nov 89 17:56:42 GMT References: <5322@wpi.wpi.edu> <20771@mimsy.umd.edu> Reply-To: peter@ficc.uu.net (Peter da Silva) Distribution: usa Organization: Xenix Support, FICC Lines: 17 How about this: union padding { int mn[2]; double d; }; block = malloc(sizeof (union padding) + whatever * sizeof (double)); ((int *)block)[0] = m; ((int *)block)[1] = n; start_of_double_array = &((union padding *)block)[1]; -- `-_-' Peter da Silva . 'U` -------------- +1 713 274 5180. "vi is bad because it didn't work after I put jelly in my keyboard." -- Jeffrey W Percival (jwp@larry.sal.wisc.edu)