How to use preprocessor in C language
This article mainly explains "how to use the preprocessor in the c language". The content of the explanation in the article is simple and clear, and it is easy to learn and understand. let's study and learn how to use the preprocessor in the c language.
1. C language has a preprocessor, which does not exist in Java. It is actually just a text replacement tool.
2. The preprocessor of C, namely CPP, will be processed in the actual compiler, and all preprocessing commands will start at #.
Example
# include # include # include / / use the macro continuation operator # define message_for (Azov b)\ printf (# a "and" # b ": love\ n") / / paste token and n as a tag # define tokenPaster (n) printf ("token" # n "=% d\ n", token##n) / / parameterized macro To define a function # define square (x) ((x) * (x)) int main () {/ / using the string constant operator message_for (Carole,Debra) / / paste int token34 = 40; tokenPaster (34); / / parameterized macro int j = square (5); printf ("j =% d", j); return 0 } Thank you for your reading. the above is the content of "how to use the preprocessor in the c language". After the study of this article, I believe you have a deeper understanding of how to use the preprocessor in the c language. the specific use also needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!