mirror of
https://gitlab.com/blau_araujo/cblc.git
synced 2025-05-10 10:36:37 -03:00
34 lines
530 B
C
34 lines
530 B
C
|
#include <stdio.h>
|
||
|
|
||
|
|
||
|
void print_list(char *list[]) {
|
||
|
int i = 0;
|
||
|
while (list[i] != NULL) {
|
||
|
printf("[%d] => %s\n", i, list[i]);
|
||
|
i++;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
int main(void) {
|
||
|
|
||
|
// Vetor de strings terminado com NULL...
|
||
|
|
||
|
char *str[] = {
|
||
|
"banana",
|
||
|
"laranja",
|
||
|
"abacate",
|
||
|
(void *)0 /* NULL */
|
||
|
};
|
||
|
|
||
|
print_list(str);
|
||
|
|
||
|
// O vetor de argumentos (argv) é um vetor de strings
|
||
|
// terminado com um ponteiro nulo (NULL)...
|
||
|
|
||
|
// print_list(envp);
|
||
|
|
||
|
return 0;
|
||
|
}
|
||
|
|