Benevolent training Camp March 11

Source: Internet
Author: User

Msmset

1 /* sets the first count bytes of the memory area in buffer to character C and returns a pointer to buffer */ 2 #include <string.h>3externvoid *meeset (void * Buffer,int c,int count);

Gets

1 /* 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, so the programmer should ensure that buffer space is large enough so that no overflow occurs while the read operation is performed.  */2 #include <stdio.h>3charChar * str);

Fgets

1 /*reads data from the file structure pointer stream, reading one row at a time. 2 The data read is stored in the character array pointed to by BUF,3 reads up to bufsize-1 characters at a time (bufsize assigned ' + '),4 if the line in the file is less than bufsize characters, the line finishes reading. 5 If the number of characters in the line (including the last newline character) exceeds bufsize-1,6 the Fgets returns only an incomplete row, but the buffer always ends with a null character,7 The next call to Fgets will continue to read the row. The function succeeds in returning BUF, failing or reading to the end of the file, returning null. 8 Therefore, we cannot judge whether a function is terminated by an error directly through the return value of fgets, and should be judged by feof function or Ferror function. */9 Ten Char*fgets (Char*buf,intBufSize, FILE *stream); One  A /* - *buf: A character pointer that points to the address used to store the resulting data.  - bufsize: Integer data indicating the size of the stored data.  the *stream: File structure pointer, the file stream that will be read.  - */

Benevolent training Camp March 11

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.