'Difference between data assignment in pointer and a variable [duplicate]

Why does the program exit with exception when i use the array variant instead of the pointer.

int main()
{

  //  unsigned char data[1920 * 1080 * 4];   this causes the  exception

    unsigned char* data = new unsigned char[1920 * 1080 * 4];

    std::cout << "Hello World!\n";
}
c++


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source