在 Xcode 4 中编写 C++

bin*_*101 3 c++ xcode stdafx.h

我正在尝试学习 C++,但我不是 Windows 的粉丝,因此使用Visual Studio并不理想。不过我的 Mac 上有Xcode

我在 Visual Studio 中用 C++ 编写了一个程序,它运行良好。当我将代码传输到 Xcode(使用 c++ 工具环境)时,它仍然可以正常工作,但它不喜欢顶部的 #include 语句。为什么?

#include "stdafx.h"
#include <stdlib.h>
#include <iostream>
#include <time.h>
Run Code Online (Sandbox Code Playgroud)

如果我使用它,它仍然不喜欢它<...>而不是"..." 它不会影响我可以看到的当前程序。

基本上我想知道它的重要性是什么?我是否或将来需要它?

End*_*ers 5

stdafx.h 是一个 windows (visual studio) 相关的头文件。只需将其删除。