Проще говоря, я проверяю, являются ли два символа char * nullptr или пустыми через оператор if
, но я получаю предупреждение о том, что разыменовываю нулевой указатель.
// mplate is a reference to a class
if ((mplate.m_plate != nullptr || mplate.m_plate[0] != '\0') || (plate != nullptr || plate[0] != '\0')) {
// Do something
}
else {
// do something else
}
Так что в основном я Я пытаюсь сказать в операторе if
, если либо mplate.mplate
, либо plate
пусто, либо nullptr
, в противном случае сделайте что-нибудь еще.
Severity Code Description Project File Line Suppression State
Warning C6011 Dereferencing NULL pointer 'make'.
Warning C6011 Dereferencing NULL pointer 'model'.
Warning C6011 Dereferencing NULL pointer 'mplate.m_plate'.
Warning C6011 Dereferencing NULL pointer 'plate'.
Warning C6011 Dereferencing NULL pointer 'plate'.