没有声明null?
我的代码:
// Include necessary libraries
#include <cstdlib> // Exits
#include <iostream> // I/O
#include <cstring> // String functions
using namespace std;
int main(int argc, char *argv[])
{
//Declare local Constants and Variables
const char SOKINP[19] = "23456789TtJjQqKkAa"; // Valid Input Characters
char acCards [5]; // Array to hold up to five cards (user input)
bool bErr; // Loop on Error (Calculated)
int i, // Loop variable (Calculated)
iNbrCrd, // Number of Cards 2-5 (user input)
iNAces, // Number of Aces (Calculated)
iTS; // Total Score (Calculated)
...
for (i=0;i<iNbrCrd;i++){
do {
cout << "Enter Card #" << i << " (2-9,t,j,q,k or a) >";
cin >> acCards[i];
cout << endl;
bErr = (strchr(SOKINP, acCards[i]) == null) ? true : false; // *ERROR*
} while (bErr);
}
return EXIT_SUCCESS;
}
[错误] 'null' 未在此范围内声明
如何声明“空”?我尝试包括其他几个库。我正在使用 Dev C++ v5.4.2
谢谢,~d