Is there any difference between delete x and delete(x)?

前端 未结 3 1469
栀梦
栀梦 2021-01-12 09:01

In C++ is there any difference between the following commands:

delete x;
delete(x);
3条回答
  •  情深已故
    2021-01-12 09:49

    It's the same as the difference between:

    i = i + 1;
    i = i + (1);
    

    i.e. none. delete is an operator, not a function.

提交回复
热议问题