I am testing some fragments that I found on the Internet using g ++ from MinGW. This is a C ++ compiler ... why then it compiles C correctly ... why people are intertwined with C and C ++.
Specific question: is it OK to use C and C ++ and compile under g ++. If so, it makes my life easy, since I do not need to change the code.
Oddly enough ... to make C ++ work, especially when passing a string to the ifstream constructor, a string of type C is required ...
My guess would be because, since C ++ depends on C constructs at times, OK writes two languages together.
However, you should rely on cout / cin or printf / scanf as a style.
c ++ c iostream printf scanf
user656925
source share