#include是类型为关键字的令牌吗? [英] Is #include a token of type keyword?

查看:256
本文介绍了#include是类型为关键字的令牌吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在学习C的同时,我的第一个话题是令牌.当我看这段代码时,很容易获得图片.

While learning C I got my first topic which was tokens. When I look at this code is pretty easy to get the picture.

int main()
{
  int x, y, total;
  x = 10, y = 20;
  total = x + y;
  printf ("Total = %d \n", total);
}  

到目前为止一切都很好...现在,当我在这里看这个时:

so far so good... Now when I look at this one here:

#include <stdio.h>

int main()
{
    /* code */
    printf("Hello C world! \n");

    return 0;
}

我想知道#include <stdio.h>中的#include是否是令牌.如果是,应该是正确的关键字吗?

I wonder if the #include in #include <stdio.h> is a token. If yes, it should be a keyword right?

推荐答案

在线

#include <stdio.h>

#include是预处理程序指令. <stdio.h>是预处理器的附加信息.在这种情况下,它指定文件名stdio.h,其内容将完全包含在要编译的文件所在位置.

#include is a pre-processor directive. <stdio.h> is additional information for the pre-processor. In this case, it specifies a file name, stdio.h, whose contents are to be included at exactly that location of the file being processed for compilation.

包含预处理器指令的行由预处理器处理,并且从源代码创建目标代码时,编译器从不会看到它们.

The lines that contain pro-processor directives are processed by the pre-processor and are never seen by the compiler when creating object code from source code.

这篇关于#include是类型为关键字的令牌吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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