简体   繁体   English

C语言如何支持大写字母而不提供或提供有关程序中大写的信息

[英]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? 它是大写的,但程序(编译和)在C语言中没有任何错误运行,但C区分大小写 - 这是如何可能的?

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

This works if you are using Windows or another operating system that ignores case on its file system. 如果您使用Windows或其他操作系统忽略其文件系统上的大小写,则此方法有效。 It doesn't work on Linux and other Unix flavours, because they do care about case (by default). 它不适用于Linux和其他Unix风格,因为它们确实关心大小写(默认情况下)。

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 . 当你添加像#include <any_file.h>这样的#include <any_file.h>语句时,C编译器会要求操作系统打开文件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. 例如,如果它找到名为aNy_fILe.H的文件,它将打开该文件并将其呈现给C编译器。

The C-compiler will interpret the content of the file - this is the case-sensitive bit of the C language. C编译器将解释文件的内容 - 这是C语言的区分大小写的位。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM