vc++6.0中c++代码能直接用吗

来源:百度知道 编辑:UC知道 时间:2024/05/28 12:06:32
我刚学c++问人家都说用vc++6.0 我把工程和文件建好输入代码 运行错误。
代码是我直接抄的c++书上的:
#include <iostream.h>
void main () {
cout<<"同学们你们好";
}
想显示同学们你们好 ?怎么就错了呢

1 你确定创建的是Win32 Console Application吗?
2 确认一下“工具”->“选择”->“目录”里面的路径是不是设置对了。
3 再不行就是程序有问题。

#include <iostream.h>
void main ()
{
cout<<"同学们你们好";
}
以上代码没错
你换成这样
#include <iostream>
using namespace std;
void main ()
{
cout<<"同学们你们好";
}

你应该是没在第一行输 #include "stdafx.h"
c++都得有这个。