| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | malloc and the resulting |
DC> I have to include my own declaration because I am DC> allocating memory for a character array.. DC> When I comment it out, I run out of memory very quickly... Standard malloc() will only allocate 64K at a time. Such implementations as Borland, when running in the IDE, can only allocate a tiny bit before malloc() returns a NULL. The answer, of course, is to insert control points and then debug from outside the IDE. The cast of the pointer to type char is not necessary, and may conceal other problems with your code. The void pointer returned by malloc() is assigned the type required when it is assigned to your variable. char *Notebook = malloc(32000); This is correct. No redefinition of malloc() is necessary, and if it works at all, will only create further problems, not solving any at all. > ]* Origin: *YOPS ]I[* 8.4 GIG * RA/FD/FE * Milwaukee, WI (1:154/750) SEEN-BY: 396/1 632/0 371 633/260 267 270 371 634/397 635/506 728 810 639/252 SEEN-BY: 670/218 @PATH: 154/750 222 396/1 633/260 635/506 728 633/267 |
|
| 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™.