2014-09-25 44 views
0

三個功能我從主呼叫到從主()打印陣列這段代碼的原型聲明是什麼?

void display(int *q,int row,int col){ 
             //code 
           } 
void show(int(*q)[4],int row,int column){ 
             //code 
            } 
void print(int q[][4],int row,int column){ 
             //code 
             } 

我打電話這種顯示(),print()和顯示():

int a[3][4]={1,2,3,4,5,6,7,8,9,0,1,2}; 
display(a,3,4); 
show(a,3,4); 
print(a,3,4); 

的三個功能正在用三種不同的方式打印一個數組的元素 現在我想知道什麼是display(),print()和show()的原型聲明?

+0

'無效顯示(INT * Q,詮釋行,詮釋山口);'和'無效顯示(INT (* q)[4],int row,int column);''和'void print(int q [] [4],int row,int column);' – 2014-09-25 09:08:39

+0

'display(a,3,4);' - >例如'顯示(* a,3,4);' – BLUEPIXY 2014-09-25 09:13:51

回答

0
void display(int *q,int row,int col); 
void show(int(*q)[4],int row,int column); 
void print(int q[][4],int row,int column); 

,如果你把主要的功能則沒有必要原型聲明之前的函數定義...

+1

thanx很多。它工作正常。 – 2014-09-25 09:29:35