Why do I get "error C2006: '#include' : expected a filename, found 'identifier' "?
My source code in Visual C++ Express 2008 is as follows :
#include “stdafx.h”
#include <iostream>
int _tmain(int argc, _TCHAR* argv[])
{
std::cout << “Hello world!\n”;
return 0;
}
I'm using the book, Visual C++ 2008,by Ivor Horton
.These are the errors that I'm encountering.How do I get rid of the errors ?
1>e:\m开发者_高级运维y documents\visual studio 2008\projects\hello\hello\hello.cpp(1) : error C2006: '#include' : expected a filename, found 'identifier'
1>e:\my documents\visual studio 2008\projects\hello\hello\hello.cpp(1) : fatal error C1083: Cannot open include file: '': No such file or directory
Thanks!
Use double quotes "
to surround stdafx.h
and Hello world!\n
Currently you are using some inverted quotes/quotation marks.
If you copied the code example directly from your source code, it seems that you have Unicode curly double quotes ( Unicode | U+201C (decimal: 8220) ) when the compiler is expecting ASCII double quotes ( ASCII | 34 (hex: 22 | octal: 0042 | binary: 00100010) | Unicode | U+0022 (decimal: 34) )
精彩评论