Interleave Switch Cases Within Other Control Structures | C Programming Tutorial
2.2K views on YouTube
Learn how to interlace the cases of a switch statement with the bodies of other control structures in C, a “coding trick” that is a bit of a hidden feature in the sense that it’s not well known or widely used. Though not at all advisable to use in practice for producing understandable and readable code, the technique does have the odd practical application, such as Duff’s Device: https://en.wikipedia.org/wiki/Duff%27s_device. Source code: https://github.com/portfoliocourses/c-example-code/blob/main/interlace_switch_cases_control_structures.c. Check out https://www.portfoliocourses.com to build a portfolio that will impress employers!