Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.
Login
Login
OnlineGDB Q&A
Questions
Unanswered
Tags
Ask a Question
Ask a Question
what the function f2 doing in the below program ?
0
votes
asked
Sep 3, 2019
by
function
explain about the function(void f2()) doing
void f1(int *p);
void f2(int b[]);
main()
{
int a[5]={10,20,30,40,50};
f1(a);
f2(a);
getch();
}
void f1(int *p)
{
++p;
printf("%d",*(p+1));
}
void f2(int b[])
{
b++;
printf("%d",b[1]);
}
Please
log in
or register to answer this question.
1 Answer
0
votes
answered
Sep 3, 2019
by
anonymous
It seems to be printing the next element in the array.
Element 1 is 20 so b++ would move to element 2 which is 30.
Prints 3030
Please
log in
or register to add a comment.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and receive answers from other members of the community.
...