Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of C++ input and output streams

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article is to share with you the content of a sample analysis of C++ 's input and output streams. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Input and output streams

Input data from the keyboard and output to the display screen. This kind of input and output is called standard input and output, which is referred to as standard Imax O.

Input data from the disk file, and output the data to the disk file, which is referred to as the file Icano.

Input and output to the specified space in memory, usually designating an array of characters as the storage space (storing any information), called string input and output, or string Icano for short

Buffer: both input and output exist in the cache.

Standard input stream

Commonly used member functions

Get () to get a character

Char c = cin.get ()

The newline character in the home buffer can be removed with cin.get (). Pay attention to the type of return value and the type of data it takes when it is output.

2cin.get (two parameters) get string

The parameter is the name and number of the string array

When using the string cin.get (two arguments), the newline character\ 0 is left in the buffer.

Char buf = {0}; cin.get (buf, 100); cout

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report