[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Own assert() -> Segmentation fault
From: |
StreamKid |
Subject: |
Own assert() -> Segmentation fault |
Date: |
5 Nov 2006 07:10:53 -0800 |
User-agent: |
G2/1.0 |
why is a segmentation fault caused in this simple thing???
and what exactly is this kind of error???
sorry, n00b things :/
******************************************************
*#define DEBUG
*#include <cstdio>
*
*#define assert( x ) \
* if( ! ( x )) \
* { \
* printf( "\nERROR!! Assert %s failed", #x ); \
* printf( "\n on line %s", __LINE__ ); \
* }
*
*
*int main()
*{
* int x = 5;
* printf( "first assert" );
* assert( x == 6 );
* return 0;
*}
******************************************************
******************************************************
*first assert
*ERROR!! Assert x == 6 failed
*Segmentation fault
******************************************************
- Own assert() -> Segmentation fault,
StreamKid <=