Why dos K&R say cast is required? 
Author Message
 Why dos K&R say cast is required?

The text says when using malloc and calloc that the cast is required.  I
understand why I shouldn't; but, why are they telling me otherwise?

Sean



Thu, 03 Feb 2005 12:01:12 GMT  
 Why dos K&R say cast is required?

Quote:

> The text says when using malloc and calloc that the cast is required.
> I understand why I shouldn't; but, why are they telling me otherwise?

It is mistake #142
http://cm.bell-labs.com/cm/cs/cbook/2ediffs.html

--
 pete



Thu, 03 Feb 2005 12:22:11 GMT  
 Why dos K&R say cast is required?

Quote:

> The text says when using malloc and calloc that the cast is required.  I
> understand why I shouldn't; but, why are they telling me otherwise?

It's a mistake.  Go look at the K&R errata, you'll see.


Thu, 03 Feb 2005 12:20:38 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Why is casting required here?

2. I am sorry for saying this but

3. Newbie very puzzled - no cast required??

4. Help with structure element casting required

5. casting for varargs required?

6. DDX_Int - Compiler says undeclared, I say it is.

7. "Avoid K&R" (says AOL)

8. DOS/Windows file header information required

9. I am a begginer with borland turbo c for dos

10. DOS newbie help required

11. DOS newbie help required

12. KC/OP-KS-Visual C++/MFC/COM Developers

 

 
Powered by phpBB® Forum Software