断言失败的vc++文档
In this article, we’ll take a look at using the concept of assertions, using the assert in C/C++.
在本文中,我们将研究使用断言的概念,以及在C / C ++中使用断言。
This is not very hard to understand, so let’s get started!
这不是很难理解的,所以让我们开始吧!
We’ll first look at what we mean by an assertion, and then look at how we can use it in our C programs to debug effectively!
我们将首先了解断言的含义,然后了解如何在C程序中使用它来有效调试!
什么是断言? (What is an assertion?)
An assertion is a specification that verifies that a program satisfies certain conditions at particular points, during its execution (run-time condition checks).
断言是一种规范,用于在程序执行期间(运行时条件检查)验证程序在特定点上满足某些条件。
For computer programs, there are primarily three types of assertions checks:
对于计算机程序,主要有三种断言检查类型:
- Precondition Assertion -> Condition satisfied before main body execution 前提条件断言 ->执行主体之前满足条件
- Post-condition Assertion