cout and cin are not functions, so what are they?

后端 未结 4 1151
予麋鹿
予麋鹿 2021-01-30 18:28

Generally in C programming language We consider printf and scanf to be functions. when it comes to cout and cin, in C++ what are they?I mean they cant be functions as they are n

4条回答
  •  独厮守ぢ
    2021-01-30 19:15

    Suppose x is an variable ( let integer type ) .We want to put value in it.What we do ?

    We write cin>>x .

    But we can also put the int data by writing cin.operator>>(x) . This implies cin is an object and operator >> is a function in which x is passed .

提交回复
热议问题