Summary of the sixth day of Camp David

Source: Internet
Author: User

Today, Shan Ge explained preprocessing, macro definition, array, and drawing, macro definition ....

 

Compile preprocessing: the work done before the source program is compiled. It is done by the Preprocessing Program. During compilation, the system will automatically reference the Preprocessing Program to process the preprocessing commands in the source program.

Preprocessing commands: commands starting.

 

# Define is a macro definition. Before the main function, data of the function type is defined. By default, only one row can be controlled, but multiple rows can be continued with the '\' extension, if you need to cancel the macro definition in the main application, you can use # UNDEF to cancel the following functions # define defined parameters.

# Define R/* # undef r */void main (void) {float C, r, s; printf ("Enter your value :"); scanf ("% F", & C); # ifdef RR = 3.14159 * C; printf ("macro definition: % F \ n", R ); # elses = C * C; printf ("cancelling macro definition % F \ n", S); # endif}

The assert macro is also an asserted function and can only be used in the debug version.

#include<assert.h>#include<stdio.h>#include<stdlib.h>structITEM{intkey;intvalue;};/*additemtolist,makesurelistisnotnull*/voidadditem(structITEM*itemptr){assert(itemptr!=NULL);/*additemtolist*/}intmain(void){additem(NULL);return0;}

 

Create your own database:

Create a user-defined function in the. h file and. M file, and then obtain the. h and. A files for third-party users. In this way, your source code can be stolen.

 

Array:

In C, arrays are constructed data types. An array can be divided into multiple array elements, which can be basic data type or constructor type. Therefore, Arrays can be divided into numeric arrays, character arrays, pointer arrays, Structured arrays, and other categories based on the types of array elements.

Summary of the sixth day of Camp David

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.