[英]combining ## and _type in preprocessor directives
此代碼段中的用法thread##_type
的用途是什么? 我知道下划線t (_t)
用作命名來標識類型的約定,下划線類型(_type)
經常在typedef
語句中使用。 我也理解macros
##
表示串聯。 _type
還有其他用途嗎? (例如使用雙下划線__FILE__
)?
#define THREAD_TYPE(thread)
typedef struct \
{ \
pthread_t pthread; \
int err; \
} thread##_type;
_type
在C中沒有特殊含義。此代碼_type
作者選擇的方式修飾名稱,僅此而已。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.