There are several ways to read a string in C, such as scanf () with%s, but this method can only get one word, which means that a null character, such as a space, is returned. If you want to read a line of strings, for example:
I Love BIT
In this
There are several ways to read a string in the C language, such as scanf () with%s, but this method can only get one word, that is, a null character, such as a space , is returned. If you want to read a line of strings, such as:I Love BITIn this
The following text: This article mainly introduces the PHP file read and write operation related function Summary, this article summarizes fwrite (), Fread (), fgets (), fgetc (), file (), ReadFile () and other functions of the introduction and use
Fgets (read a string from the file)Related functions: open, fread, fscanf, GETCHeader file include Define the function char * fgets (char * s, int size, file * stream );Function Description: fgets () is used to read characters from the file referred
Gets the string function read from the standard input device. Can be read indefinitely without judging the upper limit to return to the end of the read. The function's specific functions are as follows: reads a string from the stdin stream until it
PHP with Fgets read the string, it would have encountered a newline stop reading, but the actual will be in the back of the string to read something, I feel is the cause of Windows line, \ r \ n, this may be the reason, there is always a space,
Today hastily the fourth chapter knot, the back of the content analysis is not very detailed, even the book examples are not how to experiment, or wait for a chance later.Starting with section 5.3, this section focuses on 3 streams that are
1.scanfCHARSTR[15];scanf ("%s", str);ABC 1231) do not read into spaces and enter, end from space2) The input string is longer than the number of character array elements no error3) When the input is a character pointer, the pointer must already
CTypeThe functions in ctype.h are used to parse characters. Common methods are as follows:ToLower (): Returns the lowercase form of the parameter. If it is lowercase, it will return to that lowercase character directly.ToUpper (): Returns the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.