From: "Lars Hansen" Newsgroups: comp.os.msdos.djgpp Subject: Re: sizeof(struct x) doesn't compile -- how to do it ? Date: Thu, 16 Jan 2003 23:05:46 +0100 Organization: 1&1 Internet AG Lines: 12 Message-ID: References: <3E271F40 DOT D20EC4DD AT phekda DOT freeserve DOT co DOT uk> NNTP-Posting-Host: p5083890a.dip0.t-ipconnect.de X-Trace: news.online.de 1042754750 8064 80.131.137.10 (16 Jan 2003 22:05:50 GMT) X-Complaints-To: abuse AT online DOT de NNTP-Posting-Date: 16 Jan 2003 22:05:50 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com > If you are writing a C program, you need to write this: > > struct x* n=malloc(2*sizeof(struct x)); > > With C++ struct x { ... }; defines 'x' as a type in itself. In C you need a > typedef. > ok; thanks for the info!