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
BYTES
Product Launch
Updates
Developer Toolkit
Today's Posts
Member List
Calendar
Home
Forum
Topic
C
How to reduce to multiple if / else statements..
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
avinash jain
New Member
Join Date:
Aug 2007
Posts:
12
#1
How to reduce to multiple if / else statements..
Oct 4 '07, 07:34 AM
Could any one guide me how do we reduce nested if / else statements..
Savage
Recognized Expert
Top Contributor
Join Date:
Feb 2007
Posts:
1759
#2
Oct 4 '07, 07:37 AM
Originally posted by
avinash jain
Could any one guide me how do we reduce nested if / else statements..
Read
here
about switch.
Savage
Comment
Post
Cancel
weaknessforcats
Recognized Expert
Expert
Join Date:
Mar 2007
Posts:
9214
#3
Oct 4 '07, 03:55 PM
Are you using C++?
If so, nested
if
statements are a sign of packing multiple functions into ine function. Same situation with the switch statement.
Change the design to use overloaded functions instead.
Comment
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
👍
👎
☕
Comment