Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
C++11 より前に作成されたライブラリを使用する必要があり、関数の 1 つが型キャスト NULL を返す可能性があります。C++ 11 標準に従ってプログラムを作成しようとしているので、null 参照から保護する場合は、次のようなものを使用します。
if(retPtr==nullptr){...}
これは安全な比較ですか?引数のために、(int*)NULL と (int*)nullptr の間で言いますか? または、次を使用する必要があります。
if(retPtr){...}?