I am going to prompt the user to enter their street name (is a single word) and separated by a space, their house number. The user will give me 10 of these at the prompt.
I am going to put the street name into one array, and the house number into another. So far I have the code shown below. It results in a segmentation fault. I have read all of my notes and I am still unsure why this is happening. Any help is greatly appreciated. (Note, the second loop was to see if the street array was correctly storing its elements).
#include <stdio.h>
int main (void){
char *street[10];
int *number[10];
int i;
for (i=0;i<10;i++){
printf("Enter street and number: \n");
scanf(" %s %d", street[i], number[i]);
}
for (int i=0;i<10;i++){
printf("%s ",street[i]);
}
}