#include "stdafx.h"
#include <iostream>
#include <string>
int *new_int()
{
return (int *)malloc(sizeof(int));
}
int *new_int(int n)
{
int *ptr = 0;
ptr = (int *)malloc(sizeof(int));
*ptr = n;
return ptr;
}
void delete_int(const int *ptr)
{
free(const_cast<int *>(ptr));
return;
}
int main()
{
using namespace std;
const int *ptr = 0;
ptr = new_int(10);
cout << *ptr << endl;
delete_int(ptr);
return 0;
}