How C supports upper case letters without providing or providing upper case information in a program

#include<STDIO.H> 

It's uppercase, but the program (compiles and) starts without errors in the C language, but C is case sensitive - how is this possible?

 #include<STDIO.H> #include<CONIO.H> main() { printf("hello"); getch(); } 
+5
source share
1 answer

This works if you use Windows or another operating system that ignores case in your file system. It does not work on Linux and other Unix accessories because they really care about the case (by default).

When you add an include statement, such as #include <any_file.h> , the C compiler will ask the operating system to open the any_file.h file.

If your operating system does not care about the case, then it will open any file that matches the template. If he, for example, finds a file named any_file.h , it will open the file and present it to the C compiler.

The C compiler will interpret the contents of the file - this is a case-sensitive bit of C.

+9
source

Source: https://habr.com/ru/post/1260255/


All Articles