How does while (std::cin >> value) work?

前端 未结 3 1281
逝去的感伤
逝去的感伤 2021-01-18 05:29

In an example given in C++ Primer,

#include 
using namespace std;

int main() {
    int sum = 0, value = 0;  
    while (std::cin >> va         


        
3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-18 06:15

    If you are a beginner you don't need to write

    std::


    everytime. If you have written:

    using namespace std;


    it would do the trick. I hope you got the point. :)

提交回复
热议问题