Is 'private' a C keyword?

前端 未结 3 1985
自闭症患者
自闭症患者 2021-01-04 01:06

Are \'private\' or \'public\' keywords in ANSI C (or any other C for that matter), or were they only added in C++ (and Java, C#, ...)?

3条回答
  •  耶瑟儿~
    2021-01-04 01:38

    private is not a C89 or C99 keyword. See C Programming/Reference Tables on Wikibooks*.

    Also, C has nothing** to do with Java and C# (and, really, not C++ either). However, the converse is not true -- C++ grew from C, for example.

    * Better reference needed!
    ** Actually, C89 "borrowed" the const and volatile keywords from C++. Likewise, C99 "borrowed" the inline keyword, and also added _Bool and _Complex (like C++'s bool andcomplex, respectively) [citation-needed].

提交回复
热议问题