Skip to content

Commit b76f3dc

Browse files
laialaodiLight-City
authored andcommitted
fix english style and code translate
1 parent 0afdf20 commit b76f3dc

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

english/basic_content/assert/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99

1010
## 1.First assertion case
1111

12-
assert,**is macro,rather than function**
12+
Assert, **is macro,rather than function**.
1313

14-
assert The prototype of a macro is defined in <assert.h>(C)、<cassert>C++).If its condition returns an error,Program execution is terminated.
14+
Assert the prototype of a macro is defined in <assert.h>(C) or <cassert>(C++). If its condition is false or returns an error, program execution will terminate.
1515

16-
You can close assert by defining 'ndebug', **But it needs to be at the beginning of the source code,before include <assert.h>.**
16+
You can disable assert by defining macro `NDEBUG`, **But it needs to be at the beginning of the source code,before include <assert.h>.**
1717

1818
```c
1919
void assert(int expression);
@@ -49,11 +49,11 @@ assert: assert.c:13: main: Assertion 'x==7' failed.
4949

5050
+ Assertions are mainly used to check for logically impossible situations.
5151

52-
>For example, they can be used to check the state that code expects before it starts to run, or after the run is complete. Unlike normal error handling, assertions are usually disabled at run time.
52+
> For example, they can be used to check the state that code expects before it starts to run, or after the run is complete. Unlike normal error handling, assertions are usually disabled at run time.
5353
5454
+ Ignore the assertion and add at the beginning of the code:
5555
```c++
56-
#define NDEBUG // Adding this line,then you do not need the assert
56+
#define NDEBUG // Adding this line,then assert will be disable
5757
```
5858

5959
> Code Example:[ignore_assert.c](./ignore_assert.c)

english/basic_content/assert/ignore_assert.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/**
22
* @file ignore_assert.c
3-
* @brief 忽略断言
4-
* @author 光城
3+
* @brief Ignore assertion
4+
* @author Light-City
55
* @version v1
66
* @date 2019-07-25
77
*/
88

9-
# define NDEBUG // 忽略断言
9+
#define NDEBUG // ignore assertion
1010

1111
#include<assert.h>
1212

0 commit comments

Comments
 (0)