0 0 votes please tell how to solve it? Programming in C + – Aakash1125 1.1k views answer comment Share Follow Print See all 5 Comments 5 5 Comments reply Kapil commented Apr 19, 2017 reply Follow flag What is ur doubt here ? 0 0 replyShare Aakash1125 commented Apr 19, 2017 reply Follow flag foo(ary); passes the base address to fn definition but how this base address is using in fn definition. i found difficulty to understand void foo(int p[4]) fn definition 0 0 replyShare Arjun commented Apr 20, 2017 reply Follow flag If you are coding them, why not add question as text? 1 1 replyShare AnilGoudar commented Apr 20, 2017 reply Follow flag Hi Aakash1125, Output will be - 10,1 You are correct that In C, array name represents address and when we pass an array. Note: When we pass like that, we actually pass address and the parameter receiving function always accepts them as pointers. The foo() function can also be written like this, void foo(int *p) { int i=10 p = &i; printf("%d ", p[0]); } The pointer "p" will point to array initially, when we pass to function. But when the statement, p=&i; executes, now "p" will point to the variable i. so it would be like, 2 2 replyShare Aakash1125 commented Apr 20, 2017 reply Follow flag thank you sir. I did not know (Note: When we pass like that, we actually pass address and the parameter receiving function always accepts them as pointers.)but now I feel at home with this concept... :) 0 0 replyShare Please log in or register to add a comment.
1 1 vote hope it helps...... akash.dinkar12 answered Apr 20, 2017 akash.dinkar12 comment Share Follow See 1 comment 1 1 comment reply Aakash1125 commented Apr 20, 2017 reply Follow flag great,,,, thank you 0 0 replyShare Please log in or register to add a comment.