Skip site navigation (1)Skip section navigation (2)
Date:      30 Apr 2002 17:52:06 +0200
From:      Dag-Erling Smorgrav <des@ofug.org>
To:        Francis Jordan <francrj@yahoo.com>
Cc:        freebsd-chat@freebsd.org
Subject:   Re: strange gcc warning
Message-ID:  <xzpheltrxp5.fsf@flood.ping.uio.no>
In-Reply-To: <20020430132306.1282.qmail@web20405.mail.yahoo.com>
References:  <20020430132306.1282.qmail@web20405.mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Francis Jordan <francrj@yahoo.com> writes:
> This may seem like a newbie question, but still -- why
> does the following produce a warning:
> 
> void
> foo(const int b[8][8])
> {
> }

Arrays degenerate to pointers when passed as arguments to functions.
You can wrap it in a struct if you want to keep the size information;
otherwise foo() will have to do the necessary pointer arithmetic "by
hand".

DES
-- 
Dag-Erling Smorgrav - des@ofug.org

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-chat" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?xzpheltrxp5.fsf>