- 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

24th Nov 2016, 2:00 PM
Sumit Yadav
2 Respostas
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);
25th Nov 2016, 12:46 AM
Bohdan Shevchenko
Bohdan Shevchenko - avatar
- 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); }
15th Mar 2021, 10:47 AM
Dibyendu Das
Dibyendu Das - avatar