Skip to content

Commit 1ed1dba

Browse files
author
Colin Robertson
authored
Merge pull request MicrosoftDocs#1504 from MicrosoftDocs/master637014027121736839
Fix git push error for protected CLA branch
2 parents e1fe426 + fd77089 commit 1ed1dba

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/cpp/delete-operator-cpp.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Deallocates a block of memory.
1111

1212
## Syntax
1313

14-
> [`::`] `delete` *cast-expression*
14+
> [`::`] `delete` *cast-expression*\
1515
> [`::`] `delete []` *cast-expression*
1616
1717
## Remarks
@@ -26,7 +26,7 @@ delete MyDialog;
2626

2727
Using **delete** on a pointer to an object not allocated with **new** gives unpredictable results. You can, however, use **delete** on a pointer with the value 0. This provision means that, when **new** returns 0 on failure, deleting the result of a failed **new** operation is harmless. For more information, see [The new and delete Operators](../cpp/new-and-delete-operators.md).
2828

29-
The **new** and **delete** operators can also be used for built-in types, including arrays. If `pointer` refers to an array, place empty brackets before `pointer`:
29+
The **new** and **delete** operators can also be used for built-in types, including arrays. If `pointer` refers to an array, place empty brackets (`[]`) before `pointer`:
3030

3131
```cpp
3232
int* set = new int[100];
@@ -80,10 +80,10 @@ For examples of using **delete**, see [new operator](../cpp/new-operator-cpp.md)
8080

8181
The delete operator invokes the function **operator delete**.
8282

83-
For objects not of class type ([class](../cpp/class-cpp.md), [struct](../cpp/struct-cpp.md), or [union](../cpp/unions.md)), the global delete operator is invoked. For objects of class type, the name of the deallocation function is resolved in global scope if the delete expression begins with the unary scope resolution operator (::). Otherwise, the delete operator invokes the destructor for an object prior to deallocating memory (if the pointer is not null). The delete operator can be defined on a per-class basis; if there is no such definition for a given class, the global operator delete is invoked. If the delete expression is used to deallocate a class object whose static type has a virtual destructor, the deallocation function is resolved through the virtual destructor of the dynamic type of the object.
83+
For objects not of class type ([class](../cpp/class-cpp.md), [struct](../cpp/struct-cpp.md), or [union](../cpp/unions.md)), the global delete operator is invoked. For objects of class type, the name of the deallocation function is resolved in global scope if the delete expression begins with the unary scope resolution operator (`::`). Otherwise, the delete operator invokes the destructor for an object prior to deallocating memory (if the pointer is not null). The delete operator can be defined on a per-class basis; if there is no such definition for a given class, the global operator delete is invoked. If the delete expression is used to deallocate a class object whose static type has a virtual destructor, the deallocation function is resolved through the virtual destructor of the dynamic type of the object.
8484

8585
## See also
8686

87-
[Expressions with Unary Operators](../cpp/expressions-with-unary-operators.md)<br/>
88-
[Keywords](../cpp/keywords-cpp.md)<br/>
87+
[Expressions with Unary Operators](../cpp/expressions-with-unary-operators.md)\
88+
[Keywords](../cpp/keywords-cpp.md)\
8989
[new and delete Operators](../cpp/new-and-delete-operators.md)

0 commit comments

Comments
 (0)