Skip to content

Latest commit

 

History

History
33 lines (26 loc) · 666 Bytes

compiler-error-c2148.md

File metadata and controls

33 lines (26 loc) · 666 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Error C2148
Compiler Error C2148
11/04/2016
C2148
C2148
e510c2c9-7b57-4ce8-be03-ba363e2cc5d9

Compiler Error C2148

total size of array must not exceed 0x7fffffff bytes

An array exceeds the limit. Reduce the size of the array.

Example

The following sample generates C2148:

// C2148.cpp
#include <stdio.h>
#include <stdlib.h>

int main( ) {
   char MyArray[0x7ffffffff];   // C2148
   char * MyArray2 = (char *)malloc(0x7fffffff);

   if (MyArray2)
      printf_s("It worked!");
   else
      printf_s("It didn't work.");
}