I was wondering how the compiler searches for a file using just the name of the particular file. The function argument that should be supplied is the file name in double quotes and mode i.e. read, write etc. What if there are two files of the same name but in different directories? Which file does the compiler load in the memory? Suppose if I want to open a binary file in which directory should I place it for it to successfully load in memory?
If I have loaded a binary file how am I supposed to know that at what position the file is ended. For text files the ASCII value of 26 signified end of file, how do we figure out the end point of a binary file?