delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/29/12:17:04

From: Ryan McGee <rdm AT IHateSpam DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: "big" arrays in GnuC++ V2
Date: Mon, 29 Dec 1997 10:34:04 -0600
Organization: InLink
Lines: 37
Message-ID: <34A7D0FC.411BA1FC@IHateSpam.com>
References: <m0xmOjX-0004o1C AT fwd05 DOT btx DOT dtag DOT de>
NNTP-Posting-Host: iits0283.inlink.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

just a wild guess, but maybe it's having a problem allocating the memory.  Have you
tried doing this:

unsigned char *BIG;
BIG=malloc(2000000);
if(BIG == NULL)
{
    printf("ERROR");
    return -1;
}

Doesn't that do the exact same thing except checks for errors?  Correct me if I'm wrong
but can't you access it the same way? (ex BIG[500] = 'b').  That's just my 2 cents worth
anyway

Ryan
RDM AT inlink DOT com

Stritt wrote:

> Hello !
>
> In GnuC++ V1 I never had problems with "big arrays", that means for example
>
> "unsigned char BIG[2000000]" -this should allocate an array of ca 2MB.
>
> But now, whith Version 2 of GnuC++ und Go32-v2 the Compiler compiles my program, but
> when i execute it, it crashes :-(((.
>
> I really don't know what to do!
> If anyone could help me, i would be very thankful!
>
> ciao,
> mr rooTS



- Raw text -


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