Below is my code, I am getting the error "Segmentation fault (core dumped) " I'm new to C the program is supposed to get user input, "hash" it by converting to ASCII values, then it is compared to the string of ASCII numbers, printing "Secret information found!!" if the password that has been input matches
#include <stdio.h>
#include <string.h>
int password_validation(char password_input);
char hashing(char *user_input);
char user_input();
int main()
{
int k = password_validation(hashing(user_input()));
if (k == 0){
printf("\n Secret information found!!! \n");
}
else{
printf("\n try again \n");
}
return 0;
}
char user_input(){
int password_input[100];
printf("Enter the password: ");
printf("\n");
scanf("%s", password_input);
return password_input;
}
char hashing(char *user_input){
for(int i=0;i< sizeof user_input; i=i+1){
int num = user_input[i];
char hashed_password[] = "";
num = hashed_password[i];
printf(hashed_password);
return hashed_password;
}
}
int password_validation(char password_input){
printf("works");
int password_comparison = strcmp("090097099104082111104105116104083097109050048049056101104099115067104117114099104079102069109097099115095095", password_input);
return password_comparison;
}
enter code here