Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

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

Community Additions

© 2015 Microsoft