Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in C only
Search
Advanced Search
Forums
Product Launch
Updates
Today's Posts
Member List
Calendar
Home
Forum
Topic
C
Switch statement
Collapse
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
gwenky
New Member
Join Date:
Feb 2008
Posts:
10
#1
Switch statement
Mar 1 '08, 01:49 AM
Can a switch statement be static_cast'ed to become an int from a double?
Thanks....
oler1s
Recognized Expert
Contributor
Join Date:
Aug 2007
Posts:
671
#2
Mar 1 '08, 02:52 AM
Can a switch statement be static_cast'ed to become an int from a double?
Sorry, but I can't translate this question into anything meaningful. You just asked how to use static_cast to convert a switch statement from an int to a double. ...
Comment
Post
Cancel
JosAH
Recognized Expert
MVP
Join Date:
Mar 2007
Posts:
11453
#3
Mar 1 '08, 02:18 PM
Originally posted by
gwenky
Can a switch statement be static_cast'ed to become an int from a double?
Thanks....
Expressions have values that can be casted; statements don't have a value and
the switch statement isn't an expression.
kind regards,
Jos
Comment
Post
Cancel
weaknessforcats
Recognized Expert
Expert
Join Date:
Mar 2007
Posts:
9214
#4
Mar 1 '08, 04:57 PM
I think the OP wants to switch based on a double rather than an int.
If this is the case, the answer is no. You can switch only on a integer value.
Comment
Post
Cancel
gwenky
New Member
Join Date:
Feb 2008
Posts:
10
#5
Mar 2 '08, 01:48 AM
Thanks, that was what I was wondering. Sorry I did not enter my question very clearly.
Comment
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
👍
👎
☕
Comment