#Error#C4703使用了潜在的单位化本地指针变量'pBelowMask','pMask'和'pAboveMask'

时间:2017-11-10 12:58:52

标签: c++ visual-studio-2017

  

错误C4703潜在初始化本地指针变量'pBelowMask','pMask'和'pAboveMask'使用

我很想在Visual Studio 2017中安装cv blob lib,我在youtube上看到了教程。在尝试程序示例时,我得到:

enter image description here

1 个答案:

答案 0 :(得分:0)

指针在从第156行开始的if语句中有条件地初始化:

if( maskImage )
{
    pMask = (unsigned char*) maskImage->imageData + j * maskImage->widthStep;
    // don't verify if we area on first or last row, it will verified on pointer access
    pAboveMask = (unsigned char*) maskImage->imageData + (j-1) * maskImage->widthStep;
    pBelowMask = (unsigned char*) maskImage->imageData + (j+1) * maskImage->widthStep;

}

那么当没有输入if语句时会发生什么,但指针仍在代码中使用?噗?崩溃?