每当我使用短路或(|
)时,以下代码会出现段错误,并且在不短路(||
)时编译完美?
编译使用gcc -Wall ../IsNull/IsNull.c ../IsEmpty/IsEmpty.c *.c -o IsNullOrEmpty
:
#include <stdbool.h>
#include "../IsNull/IsNull.h"
#include "../IsEmpty/IsEmpty.h"
#include "IsNullOrEmpty.h"
_Bool isNullOrEmpty (char *str);
_Bool isNullOrEmpty (char *str) {
return (isNull (str) | isEmpty (str));
} /* end of isNullOrEmpty() */