powerunlimited

1011[工程程式設計] HW7-1

Jan 10th, 2013
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. void CreateArray(int **&ptr) //產生9*8的指標陣列
  2. {
  3.     int i , j;
  4.     ptr = new int*[9];
  5.     for ( i=0 ; i<9 ; ++i )
  6.         ptr[i] = new int[8];
  7. }
  8.  
  9. void SetData(int arr[], int index) //計算9*9乘法表
  10. {
  11.     int i;
  12.     for( i=1 ; i<=9 ; ++i )
  13.         arr[i-1]=i*index;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment