//Fig.1.2:fig01_02.cpp
//A first program in C++
#include<iostream.h>
int main()
{
cout<<"Welcome to c++!\n";
return 0; //indicate that program ended sucessfully
}
调试说“源文件未编译”
//Fig.1.2:fig01_02.cpp
//A first program in C++
#include<iostream.h>
int main()
{
cout<<"Welcome to c++!\n";
return 0; //indicate that program ended sucessfully
}
调试说“源文件未编译”
#include<iostream>
using namespace std;//输入输出引用命名空间
int main()
{
cout<<"Welcome to c++!\n";
return 0; //indicate that program ended sucessfully
}
按Ctrl+F5运行
在#include<iostream.h>下面加上
#include <string>
using namespace std;