1. About the file opening file Open File File * Fopen (Char * filename, * type); where the first form parameter represents the file name, you can include both paths and file names. If the file you need to open is omitted in the current directory, you can omit the path name, such as "Test.txt". The absolute path name and the file name format are: "c: //tc/test/test.txt" instead of "c: /test/test.txt". The relative path name and file name format are: "Test // Test.txt".
2. About the use of the escape character, the file is opened, I have encountered such a problem when I write a program: ................ IF ((fp = fopen ("test // Test.txt "," r ")) == null) {Perror (" Open file error "); exit (1);} .................. The program is running normally, and I put fp = fopen (" Test // Test. " TXT "," r ") is changed to FP = FOPEN (" TestTest.txt "," R ") After the program is still running. Later, it is found that the number of backslash (/) is operating normally when the number is even, and when it is odd Can't find a directory. I don't know if it is a question of escape characters?
3. About the overlap of memory allocation or the following code in the above program: char file1 [10], file2 [10]; char Arr [100]; .................. Strcpy (file1, "hescpy TEST1.TXT "); STRCPY (file2," hesc // Test2.txt "); if ((fp = fopen (file1," r ")) == null) {PERROR (" Open file error "); EXIT 1);}} ((fd = fopen (file2, "r")) == null) {PERROR ("Open file error"); exit (1);} The first file1 is turned on when the program is running, and File2 can be opened normally. I just started very tapped, the two string assignments and file opening operations were the same, there is no reason to be a can't be a, or there is a mistake. Later, I found out that the original defined variable char file1 [10], file2 [10]; the time number set setting is too small, the length of the string exceeds the size of the character array, so that the File1 is assigned to the memory in File2. In addition, the part of the File1 is overwritten immediately, and the same File2 is assigned to be stored in memory that has been assigned to Arr []. And Arr [] is not assigned, which is still outside the part. So there will be File1 that cannot be opened, and the File2 can open.
4. Conversion of long int a; int b, c;