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 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 by sara Guru (24,570 points)

Related questions

0 votes
1 answer 163 views
0 votes
1 answer 16 views
16 views asked by smith Geek (15,340 points)
0 votes
1 answer 20 views
+1 vote
2 answers 204 views
0 votes
1 answer 25 views
...