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); } 

Replay

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

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

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