Is C code still considered C++?

前端 未结 8 1149
小鲜肉
小鲜肉 2021-01-11 22:52

The comment to this answer got me wondering. I\'ve always thought that C was a proper subset of C++, that is, any valid C code is valid C++ code by extension. Am I wrong a

相关标签:
8条回答
  • 2021-01-11 23:47

    See also Is it true that there is no need to learn C because C++ contains everything. There is a large common subset of C and C++; there are lots of extensions in C++ that are not in C; there are some bits in C that are not in C++ (mostly the bits you don't want to use); and there are some bits that are in C and C++ but are different.

    0 讨论(0)
  • 2021-01-11 23:49

    I think it may be more correct to say that ANSI C is a subset of C++. Not K&R C.

    0 讨论(0)
提交回复
热议问题