new char[1]
开发者_高级运维and new char
,essentially the same thing,hm?
You have to delete char[1]
with delete[]
according to the standard, so not quite identical.
The objects created are the same, the (invisible) bookkeeping used is not.
That means that you can use the chars in the same way, but you must delete them with the matching delete operator (delete
versus delete[]
)
No. char[1] is of type char*, while char is of type char.
精彩评论