I want the user to enter 3 names, and right after the program prints these 3 names can someone tell me why is not printing anything??? I tried everything if someone could explain it..... there is no error, it simply exits after inserting the strings
#include <stdio.h>
#include <stdlib.h>
int main(){
int i, a, componentes;
char *nome;
componentes = 3;
nome = (char*) malloc(sizeof(char)*100);
printf("\n");
for(i = 0; i < componentes; i++){
// printf("String %d: ", i+1);
scanf("%s", &nome[i]);
}
printf("\n");
for(a = 0; a < componentes; a++){
printf("%s\n", nome[i]);
}
return 0;
}