c ++ some questions about the input array of characters

A, scanf pair of input strings, character arrays and% s% c there are two ways
1.% c to enter a single character, it is possible to identify and save spaces and line breaks in the character array.
2.% s for inputting a string that identifies the end of a character string by spaces and line breaks, that is input to a character string with which the array is no space.
Two, getchar () is used to enter a single character
1. spaces and line breaks he can identify and save.
Three, the gets input, the puts output
1.gets string to input line and store it in a one-dimensional or two-dimensional array of one-dimensional array, the reader until the newline character string, but the line feed is discarded, and then at the end add '\ 0'.
2.gets () can be identified and input space.
3.puts () function will automatically wrap.

Guess you like

Origin www.cnblogs.com/ZhaoHaoFei/p/12585141.html