home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / c / 19454 < prev    next >
Encoding:
Internet Message Format  |  1993-01-06  |  1.5 KB

  1. Xref: sparky comp.lang.c:19454 comp.lang.c++:18863
  2. Newsgroups: comp.lang.c,comp.lang.c++
  3. Path: sparky!uunet!UB.com!pippen.ub.com!rfries
  4. From: rfries@sceng.ub.com (Robert Fries)
  5. Subject: Re: Dynamic Mem Help
  6. Message-ID: <rfries.164@sceng.ub.com>
  7. Sender: news@pippen.ub.com (The Daily News)
  8. Nntp-Posting-Host: 128.203.1.151
  9. Organization: Ungermann Bass
  10. References: <93007.230524U10139@uicvm.uic.edu> <rfries.159@sceng.ub.com> <1993Jan8.205809.7661@klaava.Helsinki.FI>
  11. Date: Fri, 8 Jan 1993 21:45:34 GMT
  12. Lines: 30
  13.  
  14. In article <1993Jan8.205809.7661@klaava.Helsinki.FI> wirzeniu@klaava.Helsinki.FI (Lars Wirzenius) writes:
  15.  
  16. >rfries@sceng.ub.com (Robert Fries) writes:
  17. >>You'll have to use an explicit cast of this value to 
  18. >>assign it to a variable of type 'char *', e.g.:
  19. >>
  20. >>      str = (char *)calloc(10, sizeof(char));
  21.  
  22. >This is required in C++ only, not in ANSI C.
  23.  
  24. >In ANSI C no casts are needed when assigning a "void *" to a pointer
  25. >to any data type (not including pointers to functions), or the other
  26. >way around.
  27.  
  28. >--
  29. >Lars.Wirzenius@helsinki.fi  (finger wirzeniu@klaava.helsinki.fi)
  30. >   MS-DOS, you can't live with it, you can live without it.
  31.  
  32. Oops, you're absolutely right.
  33.  
  34. Robert
  35.  
  36. //////////////////////////////////////////////////////////////////////////
  37. Robert Fries
  38. Ungermann-Bass Inc.
  39.  
  40. DISCLAIMER:
  41.     Opinions contained herein are my own, and are not necessarily those
  42.     of Ungermann-Bass.
  43. //////////////////////////////////////////////////////////////////////////
  44.