Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!ames!hc!lanl!cmcl2!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: malloced structure initilization Message-ID: <9640@smoke.BRL.MIL> Date: 10 Feb 89 14:09:21 GMT References: <202@sabin.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 6 In article <202@sabin.UUCP> bjm@sabin.UUCP (Brendan J. McMahon) writes: >How do you initialize memory malloced for a structure without using calloc, >and without initilizing each structure element explicitly? Copy a preinitialized (static) structure onto the freshly allocated one. In modern C this can be done with a single assignment expression.