경고 C26494

변수 'variable'은 초기화되지 않습니다. 항상 개체를 초기화합니다.

설명

이 검사 선언 또는 다음 문에서 지역 변수를 초기화해야 합니다.

예시

#include <iostream>
void function()
{
    int myVal; // C26494, Variable is uninitialized
    std::cout << myVal; // C6001
}

이 문제를 해결하려면 선언에서 변수를 초기화합니다.

#include <iostream>
void function()
{
    int myVal{};
    std::cout << myVal;
}

참고 항목

ES.20: 항상 개체 초기화
C++ 핵심 지침 유형.5