小编the*_*igC的帖子

((Code::Blocks)) - 致命错误:stdafx.h:没有那个文件或目录

我正在使用 Code::Blocks 版本 16.01,我正在从 www.learncpp.com 的第 1.3a 课中学习。我的代码如下所示:

#include <iostream>
#include "stdafx.h"

int main()
{
    std::cout << "Enter a number: "; // ask user for a number
    int x = 0;
    std::cin >> x; // read number from console and store it in x
    std::cout << "You entered " << x << std::endl;
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

整个程序运行良好,但只有一个错误,那就是#include stdafx.h; 我收到标题中列出的错误。帮助和稍微清楚的解释对我来说会很好(我显然没有经验)。

c++ codeblocks

0
推荐指数
1
解决办法
2万
查看次数

标签 统计

c++ ×1

codeblocks ×1