继续收到stdafx.h的错误 [英] Keep getting error for stdafx.h
本文介绍了继续收到stdafx.h的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,感谢大家阅读本文,当我尝试编译此代码时出现问题:
Hello and thank you everyone reading this, I am having a problem when I try to compile this code:
#include "stdafx.h"
#define password "ajay"
int _tmain(int argc, _TCHAR* argv[])
{
char pwd[100];
printf("Please enter the password::nn");
scanf("%s", pwd);
if ( strcmp(pwd, password) == 0 )
{
printf("Congratulation!!nn");
printf("Ready to login with: %s",password);
}
else
{
printf("Wrong password");
}
getch();
return 0;
}
这是我在Visual Studio Pro 2008中遇到的错误:
This the errors I get in Visual Studio Pro 2008:
error C3861: 'strcmp': identifier not found c:\users\****\documents\visual studio 2008\projects\binarycrack\binarycrack\binarycrack.cpp line - 13
&
error C3861: 'getch': identifier not found c:\users\****\documents\visual studio 2008\projects\binarycrack\binarycrack\binarycrack.cpp line - 22
推荐答案
通过在stdafx.h中添加以下行来包含stdio.h和conio.h:
Include "stdio.h" and "conio.h" by adding the following lines to "stdafx.h":
#include <stdio.h>
#include <conio.h>
如果您已经包含该文件但仍然遇到问题,请在binarycrack.cpp下添加这些行行'#include'stdafx.h'。
If you already included the file and still getting the problem, add those lines in your "binarycrack.cpp" under the line '#include "stdafx.h"'.
这篇关于继续收到stdafx.h的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文