home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!wupost!cs.utexas.edu!sun-barr!sh.wide!ascwide!ascgw!cskgw!bigbird!hun
- From: hun@bigbird.asro.csk.co.jp (Magyar fiuk)
- Newsgroups: comp.lang.c
- Subject: Re: System Testing
- Message-ID: <1122@bigbird.asro.csk.co.jp>
- Date: 24 Dec 92 02:16:02 GMT
- References: <gs-310856102441@gs.statlab.uni-heidelberg.de> <1992Dec21.172506.6739@colorado.edu>
- Organization: Advanced System Research Organization Ltd. Tokyo, Japan
- Lines: 14
-
- stasica@alumni.cs.colorado.edu (The Legacy) writes:
- >
- > void memory_test()
- > {
- > int *p, i;
- ^^^
- > p=malloc(8388608); /* Malloc 8M memory */
- > for (i=0;i<8388600;i++) /* Write to all 8M 1 char at a time */
- > *(p+i)='\0'; /* BTW this doesn't work....why??? (memory violation)*/
-
- Try char instead of int, and cast malloc to char *.
- This way *(p+i) means *(p+i*sizeof(int)).
-
- Gerzson Szinyei (hun@bigbird.asro.csk.co.jp)
-