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]);
}
Your answer
Your name to display (optional):
Email me at this address if my answer is selected or commented on:
Email me if my answer is selected or commented on
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
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
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...