为什么不在 Dev C++ 中编译

Why is it not compiling in Dev C++

这会在 C++ 中产生编译错误。你如何解决这个问题?

#include <iostream>
#include <iomanip>
#include <conio.h>


{
int year,month,day;
};

这可能是编译器没有看到包含的 header 文件。 对于语句 #include <conio.h> 确保你的 conio.h header 文件在你的编译器目录中。否则你可以使用 #include "conio.h" 并将 header 文件 conio.h 放在当前项目目录中。

此 header 声明了几个有用的库函数,用于从程序中执行 "console input and output"。大多数面向 DOS、Windows 3.x、Phar Lap、DOSX、OS/2 或 Win32 的 C 编译器都有这个 header 并在默认 C 库中提供相关的库函数。大多数以 UNIX 和 Linux 为目标的 C 编译器没有这个 header 并且不提供库函数。

它应该是一个函数吗?如果是:

#include <iostream>
#include <iomanip>
#include <conio.h>

int main() 
{
    int month, year, day;
}

在我这边编译和工作得很好。