How i write a menu program in C using a struct instead of a if else or switch statement. #202618
Replies: 2 comments
-
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
🏷️ Discussion Type
Product Feedback
Body
The example below uses a struct to map strings to functions.
the values are function pointers.
Nested if-else chains and massive switch blocks are the default way to build console menus in C.
But I did it different.
Credit note: I didn't write this code by hand—it was entirely generated by my Cstrings program.
Guidelines
Beta Was this translation helpful? Give feedback.
All reactions