What does using namespace std; do?

后端 未结 3 542
旧时难觅i
旧时难觅i 2021-01-29 17:03

What is the matter with this C++ code?

I get an error message saying: that there should be a ; before z, which is not correct. The only part t

3条回答
  •  攒了一身酷
    2021-01-29 17:31

    using namespace std; means you can write cout later on rather than std::cout. It saves typing at the expense of gross namespace pollution.

    Your compile error can be fixed by writing cout << z;

    Also, do return a value from main.

提交回复
热议问题