home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / os / msdos / programm / 9188 < prev    next >
Encoding:
Text File  |  1992-09-09  |  1.6 KB  |  70 lines

  1. Newsgroups: comp.os.msdos.programmer
  2. Path: sparky!uunet!gatech!rpi!ghost.dsi.unimi.it!cdc835.cdc.polimi.it!gin503
  3. From: gin503@cdc835.cdc.polimi.it (Maurizio Sartori Masar)
  4. Subject: Re: BC++ Far new()
  5. References: <gin503.715957220@cdc835> <18j0e6INN8ju@usenet.INS.CWRU.Edu>
  6. Date: Wed, 9 Sep 1992 07:49:59 GMT
  7. Nntp-Posting-Host: cdc835.cdc.polimi.it
  8. Organization: C.d.C., Politecnico di Milano
  9. Sender: netnews@cdc835.cdc.polimi.it (News Admin)
  10. Message-ID: <gin503.716024999@cdc835>
  11. Lines: 57
  12.  
  13. bu254@cleveland.Freenet.Edu (Stephen Groundwater) writes:
  14.  
  15. >
  16. >char far *MyBuf;
  17. >MyBuf=(char far *)new[100L];
  18. >
  19. >Voila, 100 bytes of far memory, the important bit is the L.
  20. >
  21. >Steve>
  22.  
  23. Look this program :
  24.  
  25. /**************************/
  26. #include <stdio.h>
  27.  
  28. void far * operator new( unsigned long size );
  29.  
  30. int main ()
  31.    {
  32.    char far * alpcStringArray [10];
  33.  
  34.    for (int i = 0; i < 10; i++)
  35.       {
  36.       alpcStringArray[i] = new (char[10000L]);
  37.  
  38.       printf ("Array %i is %Fp\n", i, alpcStringArray[i]);
  39.       }
  40.  
  41.    return (0);
  42.    }
  43. /**************************/
  44.  
  45. Its output is :
  46.  
  47. Array 0 is 1F2F:0792
  48. Array 1 is 1F2F:2EA6
  49. Array 2 is 1F2F:55BA
  50. Array 3 is 1F2F:7CCE
  51. Array 4 is 1F2F:A3E2
  52. Array 5 is 1F2F:CAF6
  53. Array 6 is 1F2F:0000
  54. Array 7 is 1F2F:0000
  55. Array 8 is 1F2F:0000
  56. Array 9 is 1F2F:0000
  57.  
  58.  
  59. So it uses near malloc() !
  60.  
  61. How can I call far new() ??
  62.  
  63.                     Maurizio
  64.  
  65. --
  66.   ))    ))    ))      ))))))    ))    )))))))      Maurizio Sartori Masar
  67.   ))))))))  ))  ))   ))))))   ))  ))  ))    ))   gin503@cdc835.cdc.polimi.it
  68.   )) )) )) ))))))))       )) )))))))) ))))))       Politecnico di Milano
  69.   ))    )) ))    ))  ))))))  ))    )) ))    ))            ITALY
  70.