delorie.com/archives/browse.cgi | search |
X-Authentication-Warning: | delorie.com: mailnull set sender to djgpp-bounces using -f |
From: | Horst Kraemer <hhkraemer AT web DOT de> |
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: | <gjtp8ug48vc1udaraamln8v3b26vv79jvp@4ax.com> |
References: | <Ow5i8.6142$%d1 DOT 154490 AT twister2 DOT libero DOT it> |
NNTP-Posting-Host: | pd9e6c657.dip0.t-ipconnect.de (217.230.198.87) |
Mime-Version: | 1.0 |
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" <nir_vana AT libero DOT it> 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
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |