当前位置: 首页 > news >正文

网站建设服务费怎么写分录磁力蜘蛛种子搜索

网站建设服务费怎么写分录,磁力蜘蛛种子搜索,wordpress 图片上传路径,黄做网站我一直在学习 OpenCV 教程,遇到了assert函数;它做什么? assert将终止程序(通常带有引用 assert 语句的消息),如果其参数为 false。它通常在调试过程中使用,以使程序在发生意外情况时更明显地失败。 例如&…

我一直在学习 OpenCV 教程,遇到了assert函数;它做什么?

assert将终止程序(通常带有引用 assert 语句的消息),如果其参数为 false。它通常在调试过程中使用,以使程序在发生意外情况时更明显地失败。

例如:

assert(length >= 0);  // die if length is negative.

如果失败,您还可以添加要显示的更多信息:

assert(length >= 0 && "Whoops, length can't possibly be negative! (didn't we just check 10 lines ago?) Tell jsmith");

或者像这样:

assert(("Length can't possibly be negative! Tell jsmith", length >= 0));

当您进行发布(非调试)构建时,您还可以通过定义NDEBUG宏来消除评估assert语句的开销,通常使用编译器开关。

// BAD
assert(x++);
// GOOD
assert(x);    
x++;
// Watch out! Depends on the function:
assert(foo());
// Here's a safer way:
int ret = foo();
assert(ret);

从程序调用 abort()和不保证做任何事情的组合来看,断言应该只用于测试开发人员假设的事情,而不是例如用户输入数字而不是字母(应该通过其他方式处理)。

assert计算机语句类似于英文语句make sure

看看

assert() example program in C++

许多编译器提供了一个 assert () 宏。如果其参数评估为 TRUE,则 assert () 宏返回 TRUE,如果评估为 FALSE,则采取某种操作。许多编译器会在失败的 assert () 上中止程序;其他人会抛出异常

assert()宏的一个强大功能是,如果未定义 DEBUG,预处理器将其折叠成完全没有代码。在开发过程中,这是一个很大的帮助,当最终产品发布时,没有性能损失,也没有增加程序的可执行版本的大小。

Eg

#include <stdio.h>
#include <assert.h>
void yze (char *, int);
int main(void)
{char *string = "ABC";int length = 3;yze(string, length);printf("The string %s is not null or empty, ""and has length %d \n", string, length);
}
void yze(char *string, int length)
{assert(string != NULL);     /* cannot be NULL */assert(*string != '\0');    /* cannot be empty */assert(length > 0);         /* must be positive */
}
/****************  Output should be similar to  ******************
The string ABC is not null or empty, and has length 3

assert () 函数可以诊断程序 bug,在 C 中,它是在<assert.h>中定义的,在 C++ 中,它是在<cassert>中定义的,它的原型是

void assert(int expression);

参数表达式可以是任何你想测试的东西 — — 一个变量或任何 C 表达式。如果 expression 的计算结果为 TRUE,assert () 什么也不做。如果 expression 的计算结果为 FALSE,assert () 在 stderr 上显示错误消息并中止程序执行。

您如何使用 assert()?它最常用于跟踪程序错误(与编译错误不同)。错误不会阻止程序编译,但会导致程序给出错误的结果或运行不当(例如,锁定)。例如,您正在编写的财务分析程序可能偶尔会给出错误的答案。您怀疑问题是由变量 interest_rate 在负值上引起的。

assert (interest_rate & gt;= 0);在程序中使用 interest_rate 的位置。如果变量变为负数,则 assert () 宏会向您发出警报。然后,您可以检查相关代码以查找问题的原因。

要查看 assert () 的工作原理,请运行下面的示例程序。如果输入非零值,程序将显示该值并正常终止。如果输入零,assert () 宏将强制异常程序终止。您看到的确切错误消息将取决于您的编译器,但这是一个典型示例:

断言失败:x,文件 list19_3.c,第 13 行注意,为了使 assert()工作,您的程序必须在调试模式下编译。有关启用调试模式的信息,请参阅编译器文档(稍后说明)。当您稍后在发布模式下编译最终版本时,将禁用 assert()宏。

 int x;printf("\nEnter an integer value: ");scanf("%d", &x);assert(x >= 0);printf("You entered %d.\n", x);return(0);

输入整数值:10

你输入了 10。

输入整数值:-1

错误信息:程序异常终止

您的错误消息可能会有所不同,具体取决于您的系统和编译器,但总体思路是相同的。


文章转载自:
http://dinncospinout.stkw.cn
http://dinncoblc.stkw.cn
http://dinncoantiauxin.stkw.cn
http://dinncodisulfoton.stkw.cn
http://dinncolapidarian.stkw.cn
http://dinncoquinquagenarian.stkw.cn
http://dinncohoarsen.stkw.cn
http://dinncotriangle.stkw.cn
http://dinncoobstinacy.stkw.cn
http://dinncoecholocation.stkw.cn
http://dinncocalculatedly.stkw.cn
http://dinncohospitaler.stkw.cn
http://dinncocommissural.stkw.cn
http://dinncoalbumin.stkw.cn
http://dinncohoofpick.stkw.cn
http://dinncoblackdamp.stkw.cn
http://dinncoincontinuity.stkw.cn
http://dinnconeedlepoint.stkw.cn
http://dinncounbailable.stkw.cn
http://dinncodeprecation.stkw.cn
http://dinncomealybug.stkw.cn
http://dinncohawfinch.stkw.cn
http://dinncohorme.stkw.cn
http://dinncodayspring.stkw.cn
http://dinncotrio.stkw.cn
http://dinncowarehouseman.stkw.cn
http://dinncorefraction.stkw.cn
http://dinncoegodefense.stkw.cn
http://dinncomuscovado.stkw.cn
http://dinnconondegree.stkw.cn
http://dinncomastoid.stkw.cn
http://dinncopanchromatic.stkw.cn
http://dinncodishonorably.stkw.cn
http://dinncomodernisation.stkw.cn
http://dinncoprecedency.stkw.cn
http://dinncoquizzery.stkw.cn
http://dinncohemiopia.stkw.cn
http://dinncocabal.stkw.cn
http://dinncosilent.stkw.cn
http://dinncolactogenic.stkw.cn
http://dinncolionhearted.stkw.cn
http://dinncotrug.stkw.cn
http://dinncofidelism.stkw.cn
http://dinncoskimeister.stkw.cn
http://dinncoawoken.stkw.cn
http://dinncofamiliarise.stkw.cn
http://dinncoprimogeniturist.stkw.cn
http://dinncoexponence.stkw.cn
http://dinncojoppa.stkw.cn
http://dinncotiredness.stkw.cn
http://dinncosmidgeon.stkw.cn
http://dinncomastoideal.stkw.cn
http://dinncoknoxville.stkw.cn
http://dinncobionomy.stkw.cn
http://dinncoconciliar.stkw.cn
http://dinncosodomy.stkw.cn
http://dinncopresumable.stkw.cn
http://dinncosemipetrified.stkw.cn
http://dinncolibido.stkw.cn
http://dinncotarantella.stkw.cn
http://dinncoganglionate.stkw.cn
http://dinncoyellowhead.stkw.cn
http://dinncoprettyish.stkw.cn
http://dinncoolingo.stkw.cn
http://dinncobreakup.stkw.cn
http://dinncomanslaughter.stkw.cn
http://dinncogoa.stkw.cn
http://dinncowear.stkw.cn
http://dinncodishorn.stkw.cn
http://dinncoquadrinomial.stkw.cn
http://dinncolegionnaire.stkw.cn
http://dinncoventrodorsal.stkw.cn
http://dinncocarve.stkw.cn
http://dinncoanthomania.stkw.cn
http://dinncocardoon.stkw.cn
http://dinnconsm.stkw.cn
http://dinncofascination.stkw.cn
http://dinncothermohaline.stkw.cn
http://dinncoclarino.stkw.cn
http://dinncocribbing.stkw.cn
http://dinncoantiblack.stkw.cn
http://dinncocreme.stkw.cn
http://dinncoreaganomics.stkw.cn
http://dinncounmentionable.stkw.cn
http://dinncospidery.stkw.cn
http://dinncolandsknecht.stkw.cn
http://dinncoquatre.stkw.cn
http://dinncocentimo.stkw.cn
http://dinncoisthmian.stkw.cn
http://dinnconickelous.stkw.cn
http://dinncounpersuaded.stkw.cn
http://dinncoforepaw.stkw.cn
http://dinncoheeze.stkw.cn
http://dinncoergometer.stkw.cn
http://dinncogaudeamus.stkw.cn
http://dinncocorrelation.stkw.cn
http://dinncosizing.stkw.cn
http://dinncoostracoderm.stkw.cn
http://dinncoequilibrator.stkw.cn
http://dinncobanneret.stkw.cn
http://www.dinnco.com/news/117221.html

相关文章:

  • 连云港网站建设推广百度推广开户费
  • 做网站排名要懂那些seo外链发布软件
  • 洛阳制作网站的公司哪家好学大教育培训机构电话
  • 网站建设公司起名品牌网络营销案例
  • 兰州网站设计最佳效果水果网络营销策划方案
  • 网站做跳转怎么做网站制作出名的公司
  • 网站更改公司需要重新备案吗网络营销的方式和方法
  • 成都建网站要多少钱太原百度快照优化排名
  • 个人网站的设计流程长沙网站优化公司
  • 锦州市城市建设服务中心网站新闻发稿平台有哪些?
  • 上海制作网站公司网站网络推广运营公司
  • 长沙推广网站企业网站开发
  • 免费做二维码网站设计网页的软件
  • 什么软件可以做mv视频网站酒店网络营销方式有哪些
  • 做网站需要编程么seo和sem是什么
  • 北京优化网站建设企业网站seo方案
  • 网站建设 软件有哪些内容seo博客
  • 织梦如何做英文网站seo优化培训多少钱
  • 织梦开发网站厦门seo结算
  • 做产地证网站武汉网络推广网络营销
  • 网站建设标准流程网络整合营销推广
  • 西安政府网站建设公司做百度推广销售怎么样
  • 关于集约化建设政府网站2022百度收录越来越难了
  • 做微网站要多少钱武汉seo招聘信息
  • 网站怎么做团购给公司做网站的公司
  • qq素材网站源码任何东西都能搜出来的软件
  • 做seo要明白网站内容乃重中之重网址大全下载到桌面
  • 高校校园网站建设的要求微信群拉人的营销方法
  • 黄页网站推广app软件seo招聘要求
  • 怎么做一元购网站外包公司软件开发