int** create_2Darray_int(int x, int y){ int **array2D=new int* [x]; for ( int i = 0 ; i < x ; i++ ){ array2D[i]=new int[y]; for ( int j=0 ; j<y ; j++ ){ array2D[i][j]=0; } } return array2D; };用途:
Create一個2維整數型別的Array。
用法:
x、y代表此Array的長寬,回傳指向一個內部資料為0的2維陣列的指標。
/*
int **arr = create_2Darray_int ( 4 , 5 ); //回傳一個指向4*5陣列的指標
arr[1][2]=1; //用法同一般陣列
*/
附註:
也可以將int變成double、float等資料型別。如果要宣告很多個陣列時,這個函數就很方便了!Array使用完後,記得要將空間釋放出來,請搭配下一篇( C++:Delete 各種型別的Array (函式) ( delete 的應用 ) )
Caesars Casino and Racetrack – 2021 New Jersey Gambling
回覆刪除Caesars Resort Casino 출장안마 & Racetrack is the latest casino https://jancasino.com/review/merit-casino/ in New Jersey septcasino to undergo a comprehensive https://febcasino.com/review/merit-casino/ safety review. The casino is owned worrione by Caesars