search

Home  >  Q&A  >  body text

java - c++同样的代码gcc和vs实现不同,那么我们在写程序时应该用什么编译器?

#include <iostream>
#include<conio.h>
#include<cctype>
#include<array>
using namespace std;

int main()

{
    cout<<"input:";
    array<int,10> a;
    double donation;
    cin>>donation;  //这里我输入 字母q
    cout<<donation;

}
PHPzPHPz2898 days ago474

reply all(2)I'll reply

  • PHP中文网

    PHP中文网2017-04-18 10:05:10

    This completely depends on which platform your program wants to run. In addition, C++ itself is cross-platform. What you are talking about should be the difference between VC++ and Linux C++. Not all C++ codes are implemented differently on Windows and Linux, such as stl, the pure C++ part is the same.

    reply
    0
  • ringa_lee

    ringa_lee2017-04-18 10:05:10

    Same as the production environment server. If the production environment is uncertain, it can be made cross-platform. In addition, you are entering a non-number while this is a double... This needs to be filtered in actual situations.

    reply
    0
  • Cancelreply