define as paramater in c. Why working? : in my last personal **c** project i've played a bit with files. One thing i've tried was having a define as a parameter. At the end is a code snippet so that you know what i mean.

My question is: Why is it working? Where is the data stored? Is it in line with ANSI-C?

I know that the code is not perfect, but it explains what i mean ;)


    #include <stdio.h>
    #define FILE_NAME "test.txt"

    void open_file(FILE**, char*);

    int main(int argc, char *argv[])
    {
       FILE* file;
       open_file(&file, FILE_NAME);
       return 0;
    }

    void open_file(FILE** file, char* filename)
    {
	   *(file)=fopen(filename, "r");
	}