This is part of my main function, I'm passing the char array into the get file_file(file) function.
int main(int argc, char** argv) {
char file[60];
get_file(file);
return (EXIT_SUCCESS);
}
This is the get file method that I have made. I just want it to return 'file' back to the main method to be passed into multiple other methods but I'm getting the segmentation fault straight after the scanf statement according to debugging.
void get_file(char file) {
printf("What file do you want?");
scanf(" %s",file);
//do other stuff
return file;
}