Everything included above #include "stdafx.h"
is ignored by Visual Studio. More information on why this is can be found here: What's the use for "stdafx.h" in Visual Studio?
So
#include "iostream"
#include "string.h"
#include "stdafx.h"
Must be
#include "stdafx.h"
#include "iostream"
#include "string.h"
After that you can optimize the searching for the include files by surrounding headers with the appropriate <>
or ""
. Selecting which to use is covered here: What is the difference between #include <filename> and #include "filename"?
In addition, string.h is a C header for C string utilities. It does not include the class string
. For that you need
#include <string>
If you do want the C string utilities, it is recommended you use the C++ version
#include <cstring>