关于c预处理器的愚蠢问题?澄清PLZ [英] silly question on c preprocessor? clarify plz

查看:82
本文介绍了关于c预处理器的愚蠢问题?澄清PLZ的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是预处理器,是一个单独的系统软件,还是它的一部分编译器.. ?? ..

is preprocessor ia separate system software or whether its a part of compiler..??..

推荐答案

问题根本不是愚蠢的。 C语言的定义是以某种方式进行的,因此预处理可以在单独的程序中完成。许多第一代编译器都是这样工作的。他们有一个单独的可执行程序(程序),它首先执行所有预处理并生成一个临时文件,然后由编译器处理。这个预处理器的启动通常由批处理文件或主编译程序本身完成。



现代C / C ++编译器通常有预处理器内置的,虽然你仍然可以让编译器输出预处理的源文件,通常由命令行开关控制。



不过,我会说预处理器是编译器的一部分,尽管它可能驻留在一个单独的程序中。并且我不会将其表示为系统软件,因为它不属于操作系统。
The question is not silly at all. The definition of the C language was made in a way, such that pre-processing could be done in a separate program. And many of the first generation compilers worked that way. They had a separate executable (program) that first did all the pre-processing and generated a temporary file, which was then processed by the compiler. The starting of this pre-processor was usually done by a batch-file or by the main compiler program itself.

Modern C/C++ compilers have the pre-processors usually built-in, although you can still have the compiler output the pre-processed source as a file, usually controlled by a command line switch.

Still, I would say that the pre-processor is part of the compiler, although it might reside in a separate program. And I would not denote it as "system software" as it does not belong to the operating system.


从概念上讲,预处理器是一个单独的程序。一些'编译器'将其内置。
Conceptually the pre-processor is a separate program. Some 'compilers' have it built-in.


这篇关于关于c预处理器的愚蠢问题?澄清PLZ的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆