It is not possible to use the free operator with the new allocated pointers and delete with the malloc allocated pointers because it is illegal. On the other hand, to use mallocQ and delete together for the same program or the use of new and free() for the same program is legal.
The incorrect use of these operators may lead to the error-prone conditions to occur if a new machine, a new compiler, or the same compiler's new version is used.
No comments:
Post a Comment