Question: An inlined function is a function augmented with the keyword inline. The keyword inline is a directive to the compiler to insert the function's

An inlined function is a function augmented with the keyword inline. The

 

An inlined function is a function augmented with the keyword inline. The keyword inline is a directive to the compiler to insert the function's code body in place of any call to the function. An example is below. Using all of your knowledge from this course, explain why inlined functions can allow for code to execute more quickly. A simple one sentence answer (if correct) will yield 5 marks. More elaborate (and correct) answers will earn up to 10 bonus marks. inline int foo (int a, int b) { return a+b; } int main(int argc, char** argv) { int i=10; int j = 12; int c = i+j; }

Step by Step Solution

3.41 Rating (148 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Inlined functions can allow for code to execute m... View full answer

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 Programming Questions!