动态分配内存与释放内存中出现的有关问题

动态分配内存与释放内存中出现的问题
#include <iostream>
#include <math.h>
using   namespace   std;
void   main()
{
int   i,j,p;
int   k=0;
int   *mul;
int   *res;
int   m,n,temp;
cout < < "Please   Entere   the   value   of   'n ' " < <endl;
cin> > n;
m=1+(int)(n*log10(2));
mul=new   int(m);
res=new   int(m+1);
cout < < "m= " < <m < <endl;
mul[0]=1;
res[0]=0;

for(i=1;i <m;i++)
{
mul[i]=0;
res[i]=0;
}

for(i=0;i <n;i++)
{
for(j=0;j <m;j++)
{
  res[k]=mul[j]*2+res[k];

temp=res[k];
k++;
if(res[k-1]> =10)
{
res[k-1]=res[k-1]%10;
        res[k]=temp/10;
}
}
for(p=0;p <k;p++)
{
mul[p]=res[p];

res[p]=0;
}
k=0;

}
for(i=m-1;i> =0;i--)
cout < <mul[i];
cout < <endl;
delete   []   mul;//加上这一句连结果也没有
delete   []   res;//加上这一句同上

}


该程序是想计算2的N次方,用固定数组的时候能得到正确的结果,但用的动态分配内存后就出现问题了,计算2的10次方以前的结果正确,但往后就出现警告,小的还可以有结果,但到到了解到100次方时就连结果都没有了,就只有警告,不知是何原因,请高手们帮忙看看,期待中.....



------解决方案--------------------
mul=new int(m);
res=new int(m+1);
===================
mul=new int[m];
res=new int[m+1];
应该这样