What did the. c file and. h file do separately? C

Source: Internet
Author: User
  1. Link, combine all the associated. O Target files and C function libraries in the project to generate executable files;
  2. The definition of the function is placed in a. c file, and the declaration of the function is placed in the. h file;
  3. If you want to use a function defined in a. c file, you only need to #inclued the. h file that corresponds to the. c file;
  4. The role of the. h file: Be copied by others, compile the link without the need to tube. h file
  5. Other considerations: \ n is an escape character; \ t is the TAB key; The default return value type of the printf function is int, and it returns the number of characters that are steady, not the word count, and 1 Chinese characters that account for 3 character;
  6. Self-understanding. h and. c files,. h files are also called header files, and the main function is to declare functions to function. If the system comes with the library, as long as in their own development program to introduce the header file, then the compilation can pass, because the compilation will only check syntax errors, not error, but there is a warning, as long as the link, your program will be connected with the introduction of the function definition, this time to execute the program success One is the declaration of a function, one is the definition of a function, and we place the declaration of the function in the. h file, and the definition of the function in the. c file;
  7. The declaration is to declare what method it has, not to implement it concretely; define what function it has, and develop it for others;

What did the. c file and. h file do separately? C

Related Article

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.