I am learning how to program in C and using Eclipse helios that can compile both C and C++. When I tried to create a class, it always says creating a C++ class but not C. How do I create a C class with some default setting(#include, #include, etc.) on it?
Asked
Active
Viewed 740 times
-3
-
there is no such thing in C – mfro Oct 07 '17 at 18:53
-
Yeah, no classes in C. – NiVeR Oct 07 '17 at 18:54
-
If C does not have a class, how do I program with it on Eclipse? – Steven Chan Oct 07 '17 at 19:09
-
You umm.. write code without using classes. – Martin James Oct 07 '17 at 20:32
-
You will have to write code in (and compile it as) C++ if you want to use classes. While C and C++ are similar languages, only C++ supports object-oriented programming directly. – John Bode Oct 07 '17 at 21:00
1 Answers
5
C does not have classes.
The capability of your IDE to compiler both C and C++ doesn't mean that it can transfer the constructs and concepts of C++ into a C program. It means that you can either compile a C program, or a C++ one.

gsamaras
- 71,951
- 46
- 188
- 305
-
-
1
-
@dbush do you mean I can create a C++ class and work on it? Is it compatible with C syntax? – Steven Chan Oct 07 '17 at 19:18
-