Add Stringification to C Preprocessor (#1616)

This commit is contained in:
Gerrit Prößl 2021-02-13 02:05:44 +01:00 committed by GitHub
parent 3e12cb0b43
commit 39f62fc3e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -61,7 +61,14 @@ $ cpp -P file > outfile
```
#define DST(name) name##_s name##_t
DST(object); #=> "object_s object_t;"
DST(object); #=> object_s object_t;
```
### Stringification
```
#define STR(name) #name
char * a = STR(object); #=> char * a = "object";
```
### file and line