当我用

#include "stdafx.h"

#include <iostream>

using namespace std;

void main(){

...

}

的方式的时候编译不会报错。

当我用

#include "stdafx.h"

#include <iostream.h>

void main(){

...

}

也不会报错,但是却不能用system("PAUSE");这样的方法。

如果我想用这样的方法,那么必须将

using namespace std;

提前声明;

但是如果用了using namespace std;就不能用#include<iostream.h>这样的语句,而只能用#include<iostream>

否则报错.

相关文章:

  • 2022-12-23
  • 2020-07-16
  • 2021-04-22
  • 2022-02-21
  • 2021-12-27
  • 2022-12-23
  • 2022-02-01
  • 2021-06-07
猜你喜欢
  • 2021-10-25
  • 2021-05-25
  • 2021-05-27
  • 2022-12-23
  • 2022-02-05
  • 2021-08-02
  • 2022-12-23
相关资源
相似解决方案