I am very new to c++ and am doing a tutorial. I have copied the tutorial exactly but on compiling get this error:
'String file not found'
for the line #include <string>;
Could someone tell me how to amend this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You seem to have found a solution, I’m adding this to clarify why this is happening. Some compilers integrated with IDEs treat
.cfiles as C source code an.cpp(or.cc,.c++, etc.) as C++ code. As you compile a.cfile, C++ support isn’t included and a C compiler is used instead of a C++ one. And C doesn’t have<string>(although it does have<string.h>, but that contains entirely different stuff).