Suppose that I have the following function declaration: struct x_struct my_funct
ID: 666896 • Letter: S
Question
Suppose that I have the following function declaration:
struct x_struct my_function( struct x_struct val );
While this is legal, it suffers from an inefficiency. What is the problem?
I have no idea. This is not the answer...
The function will execute slowly because "val", and the return value of the function will both require a lot of data copying. This is because C is call-by-value.
The function can not alter the original value of “val”, so passing it is not useful.
The function can alter the original structure “val”, making the code hard to follow.
The function will execute slowly because "val", and the return value of the function will both require a lot of data copying. This is because C is call-by-reference.
a.I have no idea. This is not the answer...
b.The function will execute slowly because "val", and the return value of the function will both require a lot of data copying. This is because C is call-by-value.
c.The function can not alter the original value of “val”, so passing it is not useful.
d.The function can alter the original structure “val”, making the code hard to follow.
e.The function will execute slowly because "val", and the return value of the function will both require a lot of data copying. This is because C is call-by-reference.
Explanation / Answer
b.
The function will execute slowly because "val", and the return value of the function will both require a lot of data copying. This is because C is call-by-value
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.