1 analyze and write a comparison of c u2019s malloc and free functions to c u2019s n 5346374

1. Analyze and write a comparison of C%u2019s malloc and free functions to C++%u2019s new and

delete operators. What is the same and what is different? Is one safer than the other?

2.) Let the function fun be defined as:

int fun(int *k) {

*k += 10;

return 5 * (*k) – 2;

}

Suppose fun was used in a program as follows:

void main() {

int i = 8, j = 12, sum1, sum2;

sum1 = (i / 2) + fun(&i);

sum2 = fun(&j)) + ( j / 2);

}

What are the values of sum1 and sum2

a) If the operands in the expressions are valuated left to right?

b) if the operands in the expressions are evaluated right to left?

"Get 15% discount on your first 3 orders with us"
Use the following coupon
FIRST15

Order Now