www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/01/12/17:16:35

From: Tom St Denis <stdenis AT compmore DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: array casting
Date: Fri, 12 Jan 2001 20:26:57 GMT
Organization: Deja.com
Lines: 33
Message-ID: <93npa5$pr$1@nnrp1.deja.com>
References: <3A5F2E12 DOT 9A6C50FC AT ma DOT tum DOT de> <93ndcm$l5q$1 AT nnrp1 DOT deja DOT com> <3A5F3FD0 DOT FA33C29B AT ma DOT tum DOT de>
NNTP-Posting-Host: 24.156.37.224
X-Article-Creation-Date: Fri Jan 12 20:26:57 2001 GMT
X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 98) Opera 5.01 [en]
X-Http-Proxy: 1.1 x59.deja.com:80 (Squid/1.1.22) for client 24.156.37.224
X-MyDeja-Info: XMYDJUIDtomstdenis
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

In article <3A5F3FD0 DOT FA33C29B AT ma DOT tum DOT de>,
  Waldemar Schultz <schultz AT ma DOT tum DOT de> wrote:
> Tom St Denis schrieb:
> > You can't allocate int x[][2] in C.  It's invalid since the compiler doesn'ty
> > know how manythere are.
> what I intended of course allocte x[n][2] with n not constant, I did this
> before.

That's why you do

x = realloc(x, sizeof(int **) * newnumberofpointers).

(I think that's how realloc works...I never have used it though).

> > passing myfunc(int a[]) is bad form... instead myfunc(int *a) is clearer.
> I know, but that's the libraries prototype I have to live with.

Your lib blows :-)

Well see below.


> > BTW this is OT for this group.
> sorry about that, but I dared to ask, where the answers really could be given.

Sorry I am not a C guru, just ask in comp.lang.c and they should be able to
clear things up.

Tom


Sent via Deja.com
http://www.deja.com/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019