saad shan saad shan - 14 days ago 4
C Question

How does the C language support upper case letters without giving or providing information about upper case in program

#include<STDIO.H>


It is in upper case but the program (compiles and) runs without any error in C language, but C is case sensitive — how this is possible?

#include<STDIO.H>
#include<CONIO.H>
#include<string.h>
main()
{
printf("hello");
getch();
}

NZD NZD
Answer

This works if you are using Windows or another operating system that ignores case on its file system. It doesn't work on Linux and other Unix flavours, because they do care about case (by default).

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

If your operating system doesn't care about case, then it will open any file that matches the pattern. If it, for instance, 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 content of the file - this is the case-sensitive bit of the C language.