# And # syntax in LINUXC

Source: Internet
Author: User
# And # syntax in LINUXC-Linux general technology-Linux programming and kernel information. The following is a detailed description. Today, when I looked at the Linux kernel code, I suddenly saw the appearance of # And #. In the strange syntax, I clicked the usage of # In the previous post, but I didn't check the relevant documents. As for # I won't take that preprocessing role here. Let's take a look at the sample code first:

1 # include
2
3 # define TEST_NUM 6
4
5 # define VAR2STR (var) # var
6 # define JOIN (x, y) x # y
7
8 int main (int argv, char * argc [])
9 {
10 printf ("% s: % d \ n", VAR2STR (TEST_NUM), JOIN (TEST _, NUM ));
11 return 0;
12}

The two symbols are used here. Let's take a look at the pre-processed code:
.......
938 int main (int argv, char * argc [])
939 {
940 printf ("% s: % d \ n", "TEST_NUM", 6 );
941 return 0;
942}

Let's take a look at the running results:
[Root @ works] #./test
TEST_NUM: 6

#### The functions of this Code Section are as follows:

# Convert the unelement following the Link (when blank space is met as an element) into a string, and # serves as a link.

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.