C++超级入门问题

来源:百度知道 编辑:UC知道 时间:2024/06/15 19:02:22
我在用visual studio2008,按照书上的小例子发现了一些小问题。

书上的例子是
#include <iostream>
int main()

{
using namespace std;
cout<<"Come up and C++ me some time.";
cout<<endl;
return 0;
}

书上的例子就是这样的但是我在VS2008里只打入这些并不能正常运行。在新建的文件后程序自动打出了下列代码
// new1.cpp : 定义控制台应用程序的入口点。
//

#include "stdafx.h"

int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}
什么意思?为什么没有头文件iostream啊,那我怎么用cout啊。

把自动生成的代码全部删除了,自己写。

是这样,标准不对
08应该这样写
#include<iostream>
using namespace std;
6.0非标准

这个无所谓啊,建立窗口还用winmain()呢,4个参数
int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}

#include "stdafx.h"
#include <iostream>
using namespace std;
int main()

{
cout<<"Come up and C++ me some time.";
cout<<endl;
return 0;
}

//其余删掉...

我想是你工程建错了,一般的程序是win32控制台的吧。