'Check if file exists - C programming

I've had trouble trying to create this function that takes users input and checks if the file exists or not. I keep on getting warning messages (format specifies type 'char *' but the argument has type 'const char **') every time I try to run the code.

I've tried to declare the variable fileName in different ways but it still seems to not be working. So I'm curious to know if I'm using access wrong or if it's even possible to use when taking user input.

int readFunc(const char *fileName) {
    printf("Search for file: ");
    scanf("%s", &fileName);

    if(access(fileName, F_OK) == 0) {
        menuFunc();
    } else {
        printf("File doesn't exist!\n");
    }
}
c


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source