Constructor and Destructor possible errors [on hold]

I have the code below, which uses both new and malloc to allocate memory. I think this is not exactly right, but what could be the exact issues that arise ?

#include <iostream> #include <string> using namespace std; class Test {     public:     int *i;     Test()     {         i =new int;     }     ~Test()     {         delete i;     } }; int main() {     Test *t=(Test*)malloc(sizeof(Test));     free(t); } 


Category: c# Time: 2016-07-29 Views: 0
Tags: c++11

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C), All Rights Reserved.

processed in 0.148 (s). 12 q(s)