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

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