fork download
  1. #include <stdio.h>
  2.  
  3. void ImprimeMenu(char *menuOpc[], size_t length) {
  4. for (int i = 0; i < length; i++) printf("%i - %s\n", i + 1, menuOpc[i]);
  5. }
  6.  
  7. int main(void) {
  8. char *opcSalgados[] = { "Pastel", "Mini pizza", "Coxinha", "Pao de queijo", "Pao de frango com queijo", "Pao de carne" };
  9. ImprimeMenu(opcSalgados, sizeof(opcSalgados) / sizeof(opcSalgados[0]));
  10. }
  11.  
  12. //https://pt.stackoverflow.com/q/262990/101
Success #stdin #stdout 0s 4472KB
stdin
Standard input is empty
stdout
1 - Pastel
2 - Mini pizza
3 - Coxinha
4 - Pao de queijo
5 - Pao de frango com queijo
6 - Pao de carne