From 49995735ed828623ac0c292d5516edccd1df2c78 Mon Sep 17 00:00:00 2001 From: rabix Date: Mon, 13 May 2024 10:18:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=200.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 0.md | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/0.md b/0.md index 31b7096..59786e2 100644 --- a/0.md +++ b/0.md @@ -2,18 +2,34 @@ 首先来看一段代码,这段代码可能和你平常写的也差不多,但是也有一些区别 - +```c +#include + +int main(void) { + int a = 3; + int b = 5; + + assert(a + b == 8); +} +``` 编译运行它,结果是什么都没有,这说明没有问题,那么如果不小心打错了呢,比如你是复制粘贴的第四行只改了变量名 - +``` C +#include + +int main(void) { + int a = 3; + int b = 3; + + assert(a + b == 8); +} +``` 那么很快,当你运行时,程序就会提示你预先认为的`a + b == 8`并不成立,导致出错的代码是`/app/example.c`他的行数是`7`。 - - ``` 我们把 /app/example.c:7 叫位置信息 其中/app/example.c是文件名