X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f From: Horst Kraemer Newsgroups: comp.os.msdos.djgpp Subject: Re: typedef int[10] array_di_integer Date: Tue, 12 Mar 2002 20:18:57 +0100 Lines: 23 Message-ID: References: NNTP-Posting-Host: pd9e6c657.dip0.t-ipconnect.de (217.230.198.87) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: fu-berlin.de 1015960716 16161246 217.230.198.87 (16 [27606]) X-Newsreader: Forte Agent 1.8/32.548 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Fri, 8 Mar 2002 17:26:35 +0100, "Nirvana" wrote: > Can i set a type definition like the one in the subject? The compiler says > "Parse error before '[' token" The correct definition is typedef int array_di_integer[10]; > I have to use array of struct (not only integer) as parameters or return > values, what should be done? > (C only) 1) you cannot return arrays from functions 2) my advice is never to use typedefs for arrays. The syntax for typdef'ed array parameters is deceptive because a) array parameters _are_ in fact pointer parameters and b) the are useless because the dimension of the array is ignored in a function parameter. Regards Horst