- 1
main() { int i; int marks[ ]={55,65,78,78,90,95,98}; for(i=0,i<=6,i++) disp(&marks[i]); } disp(int* n) { show(&n) } what is required in function show() to write tell me, array n pointer questions???
pointers n array question
2 Antworten
0
in this code, you call show() with address of (int*) local variable, in this case for access to variable pointed by n, you must to **n, and the prototype is : void show(int ** n);
- 1
#include<stdio.h>
int disp ( int *);
int show(int**);
int main( )
{
int i ;
int marks[ ] = { 55, 65, 75, 56, 78, 78, 90 } ;
for ( i = 0 ; i <= 6 ; i++ )
disp ( &marks[ i ] ) ;
return 0 ;
}
int disp ( int *n )
{
show ( &n ) ;
}
int show(int**p)
{
printf("%d\n",**p);
}