What kind of solution is to avoid default statement in switch ,if it is possible?Regards

Recommended Answers

Answered by djjeavons 113 in a post from

Hi

Why would you want to avoid a default statement? Do you have some code to demonstrate what you mean and why you would want to do this?

One way of avoiding a default statement in a switch is to simply not have one. What result that will have on …

Jump to Post

All 2 Replies

Hi

Why would you want to avoid a default statement? Do you have some code to demonstrate what you mean and why you would want to do this?

One way of avoiding a default statement in a switch is to simply not have one. What result that will have on your logic however is unclear without seeing some code.

Use if-else if-else if etc.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.