home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.lang.c:19447 comp.lang.c++:18856
- Newsgroups: comp.lang.c,comp.lang.c++
- Path: sparky!uunet!mcsun!news.funet.fi!hydra!klaava!wirzeniu
- From: wirzeniu@klaava.Helsinki.FI (Lars Wirzenius)
- Subject: Re: Dynamic Mem Help
- Message-ID: <1993Jan8.205809.7661@klaava.Helsinki.FI>
- Organization: University of Helsinki
- References: <93007.230524U10139@uicvm.uic.edu> <rfries.159@sceng.ub.com>
- Date: Fri, 8 Jan 1993 20:58:09 GMT
- Lines: 15
-
- rfries@sceng.ub.com (Robert Fries) writes:
- >You'll have to use an explicit cast of this value to
- >assign it to a variable of type 'char *', e.g.:
- >
- > str = (char *)calloc(10, sizeof(char));
-
- This is required in C++ only, not in ANSI C.
-
- In ANSI C no casts are needed when assigning a "void *" to a pointer
- to any data type (not including pointers to functions), or the other
- way around.
-
- --
- Lars.Wirzenius@helsinki.fi (finger wirzeniu@klaava.helsinki.fi)
- MS-DOS, you can't live with it, you can live without it.
-