Continue to Site

Welcome to

Welcome to our site! is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Standard Way of Making Menu in C

Not open for further replies.


Full Member level 4
Nov 29, 2010
Reaction score
Trophy points
Activity points
As we know that C is structured language.So what is the standard way of making menu in C like in mobile phones.

Unfortunately, there are no standard menus in C. A better question to ask is has someone built a portable menu library that has drivers for a variety of LCDs on many different processors?

I've created menu code that is fairly portable. I can't post it due to my employer's copyright but can give you the gist of what you need:

  1. Ideally you'll need some sort of interface to the LCD that supports different fonts and methods of managing different screen windows. Hopefully, you have something like this already. If not, this will be your first task.
  2. The easiest menu solution is simply to display an array of strings. The hard part will be in writing the code to traverse the menu and select items and then to execute specific commands or display sub-menus.
  3. The menu management gets a bit more complicated if you need to have multiple nested menus because you need to display other menus over top of the existing -- hence the requirement for a simple windowing system (text-based is fine).
  4. You'll probably also need some way of navigating through the menus which implies some sort of push button or navigation input device which you'll also need to write a driver for.
  5. Finally, you may want to consider a real-time tasking OS to manage the different tasks that are displaying menus, reading user inputs, and performing the menu functions. Without an RTOS, these tasks can quickly become very complex.
I would also recommend that, if this is for an embedded application, you avoid any code that uses C's memory management (i.e., malloc and friends). You will be guaranteed a run-time crash every time if you don't manage all your memory properly. I suggest, instead, that all structures be created statically and linked together statically. This is what I used and never had any problems.

I hope you realize now that, although they may appear simple, menus can quickly become very complicated.
Last edited:
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to