古月不傲 发表于 2020-8-31 07:14

C/C++ 关键字

本帖最后由 古月不傲 于 2020-8-31 07:16 编辑

//C语言关键字
defined(auto)      /* check C keywords */\
defined(break) \
defined(case) \
defined(char) \
defined(const) \
defined(continue) \
defined(default) \
defined(do) \
defined(double) \
defined(else) \
defined(enum) \
defined(extern) \
defined(float) \
defined(for) \
defined(goto) \
defined(if) \
defined(inline) \
defined(int) \
defined(long) \
defined(register) \
defined(restrict) \
defined(return) \
defined(short) \
defined(signed) \
defined(sizeof) \
defined(static) \
defined(struct) \
defined(switch) \
defined(typedef) \
defined(union) \
defined(unsigned) \
defined(void) \
defined(volatile) \
defined(while) \
defined(_Bool) \
defined(_Complex) \
defined(_Imaginary)

//C++关键字
defined(alignas)      /* check C++ keywords */ \
defined(alignof) \
defined(asm) \
defined(auto) \
defined(bool) \
defined(break) \
defined(case) \
defined(catch) \
defined(char) \
defined(char16_t) \
defined(char32_t) \
defined(class) \
defined(const) \
defined(const_cast) \
defined(constexpr) \
defined(continue) \
defined(decltype) \
defined(default) \
defined(delete) \
defined(do) \
defined(double) \
defined(dynamic_cast) \
defined(else) \
defined(enum) \
defined(explicit) \
defined(export) \
defined(extern) \
defined(false) \
defined(float) \
defined(for) \
defined(friend) \
defined(goto) \
defined(if) \
defined(inline) \
defined(int) \
defined(long) \
defined(mutable) \
defined(namespace) \
defined(new) && defined(_ENFORCE_BAN_OF_MACRO_NEW) \
defined(noexcept) \
defined(nullptr) \
defined(operator) \
defined(private) \
defined(protected) \
defined(public) \
defined(register) \
defined(reinterpret_cast) \
defined(return) \
defined(short) \
defined(signed) \
defined(sizeof) \
defined(static) \
defined(static_assert) \
defined(static_cast) \
defined(struct) \
defined(switch) \
defined(template) \
defined(this) \
defined(thread_local) \
defined(throw) \
defined(true) \
defined(try) \
defined(typedef) \
defined(typeid) \
defined(typename) \
defined(union) \
defined(unsigned) \
defined(using) \
defined(virtual) \
defined(void) \
defined(volatile) \
defined(wchar_t) \
defined(while) \
defined(final)                /* check "identifiers with special meaning" */ \
defined(override)      /* (also known as context-sensitive keywords) */ \
defined(carries_dependency)      /* check attribute-tokens */ \
defined(deprecated) && _HAS_CXX17 /* _HAS_CXX17:C++14以上关键字 */\
defined(fallthrough) && _HAS_CXX17 \
defined(maybe_unused) && _HAS_CXX17 \
defined(nodiscard) && _HAS_CXX17 \
defined(noreturn)

无意中发现的 具体过程是想看看sizeof是怎么实现的 结果转到声明就发现了这么一堆东西 无奈百度了一下 似乎就是一句宏。
如果你对哪个关键字不太熟悉 就查好了 是不是发现好多关键字都没和它"握过手"啊亲^_^ ~~ 去玩弄它吧!

是谁呀 发表于 2020-8-31 08:28

感谢分享

涛行 发表于 2020-8-31 08:47

感谢楼主分享

yjczawyl 发表于 2020-8-31 09:20

感谢分享!
页: [1]
查看完整版本: C/C++ 关键字