C/Development/Assert — различия между версиями
Admin (обсуждение | вклад) м (1 версия: Импорт контента...) |
(нет различий)
|
Текущая версия на 13:22, 25 мая 2010
Demonstrating assertions
<source lang="cpp">
- include <stdio.h>
- undef NDEBUG
- include <assert.h>
void main() {
int x = 0; int y = 5; for(x = 0 ; x < 20 ; x++) { printf("\nx = %d y = %d", x, y); assert(x<y); }
}
</source>