Mixing C and C++

Hello, I was wondering if there was any reason that I shouldn't write a single program using commands from both languages. I wrote most of it in what I believe is C (using things like scanf, printf, getche), but I noticed that a lot of things in what I believe is C++ (#include iostream.h and the like) are appealing and seemingly easier to use. I was just curious as to whether putting both of them in the same program would cause any problems, other than my assumption that it wouldn't be a very professional way to write a program (which isn't an issue in this case). I really would rather not re-code everything I've already done if possible.
Last edited on
C++ was designed to work with C, so yes, you can mix and match.

Just make sure you sync_with_stdio() if you wish to use the standard streams with both C and C++.
http://www.cplusplus.com/reference/iostream/ios_base/sync_with_stdio/

Good luck!
Topic archived. No new replies allowed.