So in my classes I've taken I was told by the teacher "case statements and if-else statements are the same things essentionally" so why learn both? and so I was not taught about cases.
Besides the fact I should learn it anyway incase I need it for someone elses code, should I learn these for an actual purpose? Are they good for something that if-else isnt as good for?
Prysm[VA]
0
Newbie Poster
Recommended Answers
Jump to Postbasically if you have series of conditions that rely on different values of the same variable then a case construct is simnpler to code than a series of if-else statements.
All 3 Replies
tinstaafl
1,161
Posting Maven
PrimePackster
10
Runaway Poster
mike_2000_17
2,669
21st Century Viking
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.