stdout vs console.write in c#

自古美人都是妖i 提交于 2019-12-04 22:56:56

In languages like C and C++, there is a global variable with the name stdout, which is a pointer to the standard output stream. Thus, stdout has become a commonly used abbreviation for "standard output stream" even outside the context of the C language.

Now, what does C# do? Let's have a look at the documentation of Console.WriteLine (emphasis mine):

Writes the specified string value, followed by the current line terminator, to the standard output stream.

So, yes, Console.WriteLine does exactly what you need to do. If you need a direct reference to the standard output stream (Hint: you usually don't), you can use the Console.Out property.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!