验证using namespace std
#include <cmath>
#include <stdio.h>
using namespace std;
int main()
{
double a = 2;
double b = cos(a);
printf("b=%f",b);
return 0;
}
错误信息:
D:\ftp\11\11.cpp(3) : error C2871: 'std' : does not exist or is not a namespace
Error executing cl.exe.
这样是不是说明#include<cmath>不需要using namespace std??????
只有#include <iostream>才需要using namespace std?
我用的是vc6