为什么这个程序编译通不过呢
这个程序是teach yourself cpp in 21 days中的代码
可是为什么我编译出错呢
// Listing 21.3 ASSERTS
#define DEBUG
#include <iostream>
using namespace std;
#ifndef DEBUG
#define ASSERT(x)
#else
#define ASSERT(x) \
if (! (x)) \
{ \
cout << "ERROR! Assert " << x << "failed" << endl; \
cout << " on line " << __LINE__ << endl; \
cout << " in file " << __FILE__ << endl; \
}
#endif
int main()
{
int x = 5;
cout << "First assert: " << endl;
ASSERT(x==5);
cout << "\nSecond assert: " << endl;
ASSERT(x != 5);
cout << "\nDone. << endl";
return 0;
}
#ifndef DEBUG
#define ASSERT(x)
#else
#define ASSERT(x) \
if (! ((x))) \
{ \
cout << "ERROR! Assert " << (x) << "failed" << endl; \
cout << " on line " << __LINE__ << endl; \
cout << " in file " << __FILE__ << endl; \
}
#endif