將數(shù)組a的首地址賦給指針數(shù)組p 用c語言編!向一維數(shù)組中第i個元素前插入一新的元素?
用c語言編!向一維數(shù)組中第i個元素前插入一新的元素?Int insert(Int*array,Int n,Int POS,Int fresh){Int re=array[n-1]for(Int i=n
用c語言編!向一維數(shù)組中第i個元素前插入一新的元素?
Int insert(Int*array,Int n,Int POS,Int fresh){
Int re=array[n-1
]for(Int i=n-1i>=POS 1i--){
array[i]=array[i-1
}]array[POS]=fresh
return re]}]n是數(shù)組的長度,POS是從零開始的位置,fresh是新數(shù)據(jù),return是丟棄的最后一個元素。建議使用鏈表