September 1998
Intermediate to advanced
848 pages
20h 13m
English
A formal argument is a variable that is defined in the function being called. The actual argument is the value appearing in the function call; this value is assigned to the formal argument. You can think of the actual argument as being the value to which the formal argument is initialized when the function is called.
void donut(int n)
int gear(int t1, int t2)
void stuff_it(double d, double *pd)
char n_to_char(int n)
int digits(double x, int n)
int random(void)
int sum(int a, int b){
return a + b;
}
Replace int with double throughout:
double sum(double a, double b)
{
return a + b;
}
This function needs to use pointers:
void alter(int * pa, int * pb)
{
int temp;
temp = *pa + *pb;
*pb = *pa - *pb;
*pa = temp;
}
or
void alter(int * pa, int * ...
Read now
Unlock full access