is it possible to put C++ code in a '.c' file?

hi friends,

as far as i know (may be i'm wrong) file with a .c file extension can have only 'c' and not 'c++' code. But recntly i've downloaded some code files with the extension '.c' (they were written for design pattern handling). But they have classes in them (i.e only C++ code has classes not C code).
1. How come it is possible to have C++ code in file with the extension '.c'?
2. How does the compiler comprehend this?

i'm confused ... please help!

cheers
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories