Question: For example: int a , b; int * pa = &a , * pb = &b; * pa = 0 ; * pb = 4

For example:
int a, b;
int * pa = &a,* pb = &b;
*pa =0; *pb =4;
update(&a,&b);
printf("a =%d, b =%d
",a,b);
*pa =1; *pb =2;
update(&a,&b);
printf("a =%d, b =%d
",a,b);
*pa =10; *pb =4;
update(&a,&b);
printf("a =%d, b =%d
",a,b);
*pa =13; *pb =11;
update(&a,&b);
printf("a =%d, b =%d
",a,b);
Results in:
a =-4, b =0
a =-1, b =1
a =6, b =40
a =2, b =143
Code given in C Language to modify (// TODO indicates the line where you should add modified code):
#include "ex1.h"
void update(int *a, int *b){
// TODO
}
 For example: int a, b; int * pa = &a,* pb

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!