ASSERT and VERIFY in VC++

Both these are used to make sure that an expression or statement in VC++ is executed properly.

In the debug version, both have no difference at all. But if you compile these statements in the release version, the one with ASSERT won’t be executed at all, but the one with VERIFY will work normally.

Eg:

CString StrMyString(“This is my string”);

ASSERT ( StrMyString.Erase(0,2));

will not cause the first two characters to be erased, if compiled in the release version.

But

VERIFY (StrMyString.Erase(0,2)) ;

will cause the first two characters to be erased.

Advertisements

One Response to ASSERT and VERIFY in VC++

  1. Praveen Kumar says:

    Great Effort Shibu. All the very best

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: