TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: Frank Adam
from: Kieran Haughey
date: 1996-01-14 17:16:54
subject: Re: Realloc

On 04 Jan 96 23:24, Frank Adam wrote to Kieran Haughey:

Hi Frank,

FA> G'Day Kieran,

FA>  -=> Quoting Kieran Haughey to All <=-

KH>> * Crossposted in area C_ECHO, AUST_C_HERE

KH>> Hi All,

KH>> I just thought I'd let you know I managed to fix, after 
KH>> looking at frank adam's example code, my realloc problems.. 
FA> Geez, you'd think the man deserves two tiny capitals ? :)

Sorry.. :).. I do that sometimes.. :)

KH>> where cur_arr_size is something like 110..
KH>> when it should have been
KH>> realloc(fareas,cur_arr_size * sizeof(FA));
FA>                     ^^^^^^^^^^^^   ^^^^^^^^^^

FA> Don't forget to cast those to a long, if the allocated memory goes passed 
FA> 655?? i forget:)..
FA> it'll wrap around to 0 and that's what you'll allocate.Hence bye-bye data.

Well so far it's doing 1400 fine .. although I'll still cast them.. I think
I may have anyway.. :)

H5, what happens if I declare it as an an unsigned int, and then typecast
the sizeof to a unsigned int, do I still need to cast the cur_arr_size?..
ÿ
Cheers,
Kieran

3:711/413.17{at}fidonet
@EOT:

--- MsgedSQ 3.30
* Origin: -=> The Last Stand Against Sanity <=- (3:711/413.17)
SEEN-BY: 50/99 620/243 623/630 711/401 409 410 413 420 423 430 510 808 809
SEEN-BY: 711/932 934 712/515 713/888 714/906 800/1 7877/2809
@PATH: 711/413 808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.