C Books Guide and List
C++ Books Guide and List
Best Java Books

3,749 questions

4,049 answers

114 comments

10,705 users

When should a type cast not be used?

0 votes
18 views
asked Apr 8, 2014 by sunny Expert (11,410 points)

1 Answer

0 votes
A type cast should not be used to override a const or volatile declaration. Overriding these type modifiers can cause the program to fail to run correctly.
A type cast should not be used to turn a pointer to one type of structure or data type into another. In the rare events in which this action is beneficial, using a union to hold the values makes the programmer’s intentions clearer.
answered Apr 8, 2014 by sara Guru (24,570 points)

Related questions

0 votes
1 answer 161 views
161 views asked Dec 20, 2011 by anonymous
0 votes
1 answer 16 views
16 views asked Apr 7, 2014 by smith Geek (15,340 points)
0 votes
1 answer 18 views
18 views asked Mar 17, 2014 by kelly johnes Advisor (6,330 points)
+1 vote
2 answers 204 views
0 votes
1 answer 25 views
...