B
Bhan
I have written code inside a c file in C++ Style(NOTE: No objects are
created by myself.I am just using singleton objects in my c file.Also
used extern "c").I am able to compile,link and test.
But my question is that how I am able to get singleton instances in a C
file?
Is that writing C++ Code in C and viceversa doesn't matter as long as
you use extern for c type of calls?
Also.how does the compiler treat the code?
- Does it treat the code inside a c file as just some piece of code of
C or c++ language?(as translation unit and not bother about the file
name?)
If yes,Can I define classes in c files and compile successfully using a
C++ Compiler?
By the way I am using GNU Compiler for C++.
created by myself.I am just using singleton objects in my c file.Also
used extern "c").I am able to compile,link and test.
But my question is that how I am able to get singleton instances in a C
file?
Is that writing C++ Code in C and viceversa doesn't matter as long as
you use extern for c type of calls?
Also.how does the compiler treat the code?
- Does it treat the code inside a c file as just some piece of code of
C or c++ language?(as translation unit and not bother about the file
name?)
If yes,Can I define classes in c files and compile successfully using a
C++ Compiler?
By the way I am using GNU Compiler for C++.