TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: Andrew Clarke
from: Frank Adam
date: 1996-06-11 18:35:08
subject: free()

G'Day Andrew,
 
-=> Quoting Andrew Clarke to Frank Adam <=-

 AC> int main(void)
 AC> {
 AC> char *ptr;
 AC> ptr = myAlloc();
 AC> free(ptr);
 AC> return 0;
 AC> }
Thanks, the more replies i get the more embarrasing this is, especially
since i thought i was pretty confident with pointers, and been using
them in a similar fashion, but never had a need of reallocating them
somewhere else. 
This was something i should've known, and i hate that.

What i would like to know now is, if the allocated size of the array 
ptr points at can be determined in some way.
I'm in the process of putting all my library function neatly together, 
and i would love to make some functions capable of determining whether a 
reallocation is necessary or not, and not rely on the programmer taking
care of it. On the other hand if a pointer is allocated and i realloc it 
willy-nilly i may actually reduce the size allocated by the programmer
and that could lead to some interesting problems later on.                 
                     
Any ideas ? 

While i got you, is vidmanager on the net yet ? 
If so, where can i get it ?
Thanks,
                    
  L8r Frank (fadam{at}ozemail.com.au).
  
___ Blue Wave/DOS v2.21

--- Maximus 3.01
* Origin: The Software Parlour (3:635/544)
SEEN-BY: 50/99 620/243 623/630 632/349 635/503 544 727 711/401 409 410 413
SEEN-BY: 711/430 808 809 932 934 712/515 713/888 714/906 800/1
@PATH: 635/544 50/99 711/808 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™.