verify

verify:核實; 證明; 判定;。

基本介紹

  • 中文名:核實; 證明; 判定;
  • 外文名:verify
  • 詞性:及物動詞
  • 類型:英語單詞
詞語解釋,同義詞,VC++宏,定義,Example,

詞語解釋

及物動詞 vt.
1.證實,核實
All those facts verified his innocence.這一切事實都證明他是無辜的。
Subsequent events verified that his judgement was at fault.接著發生的事件證實了他的判斷有誤。
2.查對;核准
3.作證;鑑定;查證
I looked up the word in a dictionary to verify its spelling.
為了查證這個詞的拼寫方法,我從詞典中查了一下這個詞。
4.【計算機】檢驗,核對 5.【軍械】核查;核實

同義詞

證明,證實
substantiate corroborate validate prove authenticate
support confirm testify certify document

VC++宏

定義

#define VERIFY(exp) ASSERT(exp) 如果exp的值為真,繼續執行;否則中止。
在VC MFC中VERIFY有另一個意思,其是一個判斷的宏,MSDN中解釋如下:
In the debug version of MFC, the VERIFY macro evaluates its argument. If the result is 0, the macro prints a diagnostic message and halts the program. If the condition is nonzero, it does nothing.
The diagnostic message has the form
assertion failed in file <name> in line <num> where name is the name of the source file and num is the line number of the assertion that failed in the source file.
In the release version of MFC, VERIFY evaluates the expression but does not print or interrupt the program. For example, if the expression is a function call, the call will be made.

Example

VERIFY can be used for things that should never fail, though you may want to make sure you can provide better error recovery. if the error can actually cause a crash in a production system. It is possible that GetDC() may fail, but the out-of-memory condition that causes it isn't likely. For a test application, this use of VERIFY() is fine. For any production code, this usage is dubious.get the display device context HDC hdc; VERIFY( (hdc = ::GetDC(NULL)) != NULL);give the display context back ::ReleaseDC(hdc);

相關詞條

熱門詞條

聯絡我們