Exforsys

Online Training

Casting can be Done or Not

This is a discussion on Casting can be Done or Not within the C and C++ forums, part of the Programming Talk category; Can I cast a malloc's return value? If I do that what will happen? Someone provide insight on this....


Go Back   Exforsys > Programming Talk > C and C++

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-26-2007, 04:38 PM
Senior Member
 
Join Date: Apr 2006
Posts: 139
Ralph is on a distinguished road
Casting can be Done or Not

Can I cast a malloc's return value? If I do that what will happen? Someone provide insight on this.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-24-2007, 09:34 AM
Member
 
Join Date: Apr 2006
Posts: 98
Angela is on a distinguished road
It is not wise and good to cast malloc's return value. It can even hide compiler warnings in some cases. No standard C programmer would do this. So don’t try to cast a malloc's return value.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 12:13 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2004 - 2007 Exforsys Inc. All rights reserved.