本文介绍了我如何使用 cout <<我的课的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!
问题描述
myclass
是我写的一个C++类,我写的时候:
myclass
is a C++ class written by me and when I write:
如何输出 10
或 20.2
,例如 integer
或 float
值?
How do I output 10
or 20.2
, like an integer
or a float
value?
推荐答案
通常通过为您的类重载 operator<<
:
Typically by overloading operator<<
for your class:
这篇关于我如何使用 cout <<我的课的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!
本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!