Compiler Warning (level 4) C4295

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Compiler Warning (level 4) C4295.

array* ' : array is too small to include a terminating null character**

An array was initialized but the last character in the array is not a null; accessing the array may produce unexpected results.

The following sample generates C4295:

// C4295.c  
// compile with: /W4  
  
int main() {  
   char a[3] = "abc";   // C4295  
}  

Show: