Skip to content

Latest commit

 

History

History
35 lines (27 loc) · 819 Bytes

compiler-warning-level-1-c4155.md

File metadata and controls

35 lines (27 loc) · 819 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Warning (level 1) C4155
Compiler Warning (level 1) C4155
11/04/2016
C4155
C4155
ba233353-09e3-4195-8127-13a27ddd8d70

Compiler Warning (level 1) C4155

deletion of an array expression without using the array form of 'delete'

The array form of delete should be used to delete an array. This warning occurs only under ANSI-compatibility (/Za).

Example

The following sample generates C4155:

// C4155.cpp
// compile with: /Za /W1
#include <stdio.h>

int main(void)
{
    int (*array)[ 10 ] = new int[ 5 ] [ 10 ];
    array[0][0] = 8;

    printf_s("%d\n", array[0][0]);

   delete array;   // C4155
    // try the following line instead
    // delete [] array;   // C4155
}