I've seen some code using the ASSERT macro and other code using the _ASSERT and _ASSERTE macros. Can anyone shed some light on what their difference are and which one(s) should be used?
Thanks,
Alvaro
Printable View
I've seen some code using the ASSERT macro and other code using the _ASSERT and _ASSERTE macros. Can anyone shed some light on what their difference are and which one(s) should be used?
Thanks,
Alvaro
ASSERT is an MFC macro, where as _ASSERT/_ASSERTE are defined in CRTDBG.H (C Runtime Library). _ASSERT is the same as ASSERT where as _ASSERTE will show the expression in the debug log.
HTH,
Chris
So do you recommend I always use _ASSERTE?
Using _ASSERTE generates more overhead for your Debug version because every expression in _ASSERTE needs to be stored in the exe as a string. I just use ASSERT from MFC and it gives you the file & line number which is enough information to find out where the problem is.
HTH,
Chris