C ++ - error with <string>
4 answers
Ok, so I changed my file name from .C to .cpp, and this particular problem seems to be gone.
You seem to have found a solution, I am adding this to clarify why this is happening. Some compilers integrated with the IDE treat .c
files as C a .cpp
source code (or .cc
, .c++
, etc.) as C ++ code. When you compile a .c
file, C ++ support is not enabled, and the C compiler is used instead of C ++. And C does not have <string>
(although it has <string.h>
, but it contains completely different things).
+4