é¤
常éæ°ç»å¤ï¼æ°ç»å¿
é¡»æ¯
å®é¿çï¼å¦æä¸ç¥éé¿åº¦ï¼æå ç§åæ³ï¼åºå®åé
ä¸ä¸ªä½ 认为ä¸ä¼åºç°ç维度å¼ï¼æè
对æ°ç»è¿è¡å¨æåé
ï¼å¦ï¼
int *pArray,nCount;
int Insert(int * pArray,int nCount,int nElement)
{
int *pInt;
pInt = new int[nCount+1];
if(nCount>0)memcpy(pInt,nArray,nCount);
pInt[nCount++] = nElement ;
if(pArray)delete pArray;
pArray = pInt;
return nCount;
}
main()
{
nCount = 0,pArray = NULL;
nCount = Insert(pArray,nCount,99);
}