TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Michael Douglass
from: David Johnson
date: 1994-06-10 05:42:30
subject: Setmem And Memset

MD>         char *myChar=new char[20];
MD>         setmem(myChar,0,sizeof(myChar));
MD> 
MD> The compiler will run right through it, never burp at all...  But when
MD> you run the program it just acts like it ignores the command.  My
MD> question is why doesn't the compiler "Burp" at me?  This is NOT a
MD> command in the Borland run-time library...

setmem is a Borland function
void setmem(void *address,int size,int value)

it does clear out or set to zero the 4 bytes that is the sizeof the
pointer myChar

IF you use setmem(myChar,sizeof(myChar),0);

you told it to set 0 bytes.. no wonder it is skipping over

David Johnson

 * A penny saved is ridiculous. 
---
 * RoseReader 2.50* P004198 Entered at [PROGRAMMERS GLD]

--- QScan v1.064b


* Origin: Programmer's Guild BBS, Hamiton, Ont. 905-525-7616 (1:244/300)
SEEN-BY: 54/54 620/243 632/348 640/820 690/660 711/409 413 430 807 808 809
SEEN-BY: 711/934 712/353 623 713/888 800/1 2442/0
@PATH: 244/300 99 12/12 270/101 396/1 3615/50 229/2 2442/0
@PATH: 711/409 54/54 711/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™.