有什么可以创建在C词法错误? [英] What can create a lexical error in C?

查看:127
本文介绍了有什么可以创建在C词法错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

除了不关闭评论 / * ... ,有什么用C构成词法错误?

Besides not closing a comment /*..., what constitutes a lexical error in C?

推荐答案

下面是一些:

 "abc<EOF>

,其中EOF是文件的结束。事实上,EOF在很多词位的中间应该产生错误:

where EOF is the end of the file. In fact, EOF in the middle of many lexemes should produce errors:

 0x<EOF>

我认为在字符串中使用不好逃脱是非法的:

I assume that using bad escapes in strings is illegal:

  "ab\qcd"

浮点指数大概麻烦

Probably trouble with floating point exponents

 1e+%

可以说,你不应该在preprocessor指令结束还有东西:

Arguably, you shouldn't have stuff at the end of a preprocessor directive:

#if x   %

这篇关于有什么可以创建在C词法错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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