Skip to content

Commit abb4ac9

Browse files
committed
Add FAQ about macro/function
1 parent fbfd628 commit abb4ac9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tutorial01/tutorial01.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,4 +451,8 @@ assert(x++ == 0); /* 这是错误的! */
451451

452452
来自于标准模型中的轻子(lepton),意为很轻量的 JSON 库。另外,建议大家为项目命名时,先 google 一下是否够独特,有很多同名的话搜寻时难以命中。
453453

454+
2. 为什么使用宏而不用函数或内联函数?
455+
456+
因为这个测试框架使用了 `__LINE__` 这个编译器提供的宏,代表编译时该行的行号。如果用函数或内联函数,每次的行号便都会相同。另外,内联函数是 C99 的新增功能,本教程使用 C89。
457+
454458
其他常见问答将会从评论中整理。

0 commit comments

Comments
 (0)