fork(1) download
  1. #include <stdio.h>
  2.  
  3. const char *menu[] =
  4. {
  5. "Customers",
  6. "Orders",
  7. "Products",
  8. NULL
  9. };
  10.  
  11. void showMenu(const char *menu[])
  12. {
  13. int i;
  14. for(i = 0; menu[i] != NULL; i++)
  15. {
  16. printf("[%d] .. %s\n", (i+1), menu[i]);
  17. }
  18. }
  19.  
  20. int main(void)
  21. {
  22. showMenu(menu);
  23. }
Success #stdin #stdout 0.01s 1676KB
stdin
Standard input is empty
stdout
[1] .. Customers
[2] .. Orders
[3] .. Products