www.delorie.com/archives/browse.cgi | search |
From: | ams AT ludd DOT luth DOT se (Martin Str|mberg) |
Newsgroups: | comp.os.msdos.djgpp |
Subject: | Re: Is realloced memory copied when necessary? |
Date: | 23 May 1999 09:19:38 GMT |
Organization: | University of Lulea, Sweden |
Lines: | 13 |
Message-ID: | <7i8h7a$hm4$2@news.luth.se> |
References: | <7i7sn2$uvt$2 AT news5 DOT svr DOT pol DOT co DOT uk> |
NNTP-Posting-Host: | queeg.ludd.luth.se |
X-Newsreader: | TIN [UNIX 1.3 950824BETA PL0] |
To: | djgpp AT delorie DOT com |
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
Reply-To: | djgpp AT delorie DOT com |
Andrew Davidson (andrew AT lemure DOT freeserve DOT co DOT uk) wrote: : I need to know if, on making a call to realloc to expand the size of some : memory I am using, will realloc copy the data from the original memory I : pass to it if it returns a different pointer, or will I have to do that : myself? Yes, it will copy your data. (If it wouldn't, then you'd just as well call malloc, memcpy and free yourself.) Alanis Morissette, Supposed Former Infatuation Junkie, MartinS
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |