home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.msdos.programmer
- Path: sparky!uunet!gatech!rpi!ghost.dsi.unimi.it!cdc835.cdc.polimi.it!gin503
- From: gin503@cdc835.cdc.polimi.it (Maurizio Sartori Masar)
- Subject: Re: BC++ Far new()
- References: <gin503.715957220@cdc835> <18j0e6INN8ju@usenet.INS.CWRU.Edu>
- Date: Wed, 9 Sep 1992 07:49:59 GMT
- Nntp-Posting-Host: cdc835.cdc.polimi.it
- Organization: C.d.C., Politecnico di Milano
- Sender: netnews@cdc835.cdc.polimi.it (News Admin)
- Message-ID: <gin503.716024999@cdc835>
- Lines: 57
-
- bu254@cleveland.Freenet.Edu (Stephen Groundwater) writes:
-
- >
- >char far *MyBuf;
- >MyBuf=(char far *)new[100L];
- >
- >Voila, 100 bytes of far memory, the important bit is the L.
- >
- >Steve>
-
- Look this program :
-
- /**************************/
- #include <stdio.h>
-
- void far * operator new( unsigned long size );
-
- int main ()
- {
- char far * alpcStringArray [10];
-
- for (int i = 0; i < 10; i++)
- {
- alpcStringArray[i] = new (char[10000L]);
-
- printf ("Array %i is %Fp\n", i, alpcStringArray[i]);
- }
-
- return (0);
- }
- /**************************/
-
- Its output is :
-
- Array 0 is 1F2F:0792
- Array 1 is 1F2F:2EA6
- Array 2 is 1F2F:55BA
- Array 3 is 1F2F:7CCE
- Array 4 is 1F2F:A3E2
- Array 5 is 1F2F:CAF6
- Array 6 is 1F2F:0000
- Array 7 is 1F2F:0000
- Array 8 is 1F2F:0000
- Array 9 is 1F2F:0000
-
-
- So it uses near malloc() !
-
- How can I call far new() ??
-
- Maurizio
-
- --
- )) )) )) )))))) )) ))))))) Maurizio Sartori Masar
- )))))))) )) )) )))))) )) )) )) )) gin503@cdc835.cdc.polimi.it
- )) )) )) )))))))) )) )))))))) )))))) Politecnico di Milano
- )) )) )) )) )))))) )) )) )) )) ITALY
-