delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/08/09/16:00:23

From: "Vermin" <ratspl AT hotmail DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: a bit about arrays...
Lines: 31
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
Message-ID: <SEik5.4799$aK5.80126@news1.online.no>
Date: Wed, 9 Aug 2000 22:00:00 +0200
NNTP-Posting-Host: 130.67.73.219
X-Complaints-To: news-abuse AT online DOT no
X-Trace: news1.online.no 965850802 130.67.73.219 (Wed, 09 Aug 2000 21:53:22 MET DST)
NNTP-Posting-Date: Wed, 09 Aug 2000 21:53:22 MET DST
Organization: Telenor Online Public Access
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I've got two questions concerning arrays:

<1>
What's the difference between

char anArray[100];

and

char *anArray;
anArray = new (char)[100];

<2>
How can I pass an array with undefined size to a procedure, and get the
procedure to set the array size (C++)??

something like this (in pseudo code):

proc aProc(array[]){
  array.size = 100;
}

int main(){
  int anArray[];
  aProc(anArray[]);
  ...
}

Thanks!


- Raw text -


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