+2 votes
24 views

In data structure , we have regular functions and inline functions. What's the difference between them in terms of syntax and how it stores it memory (memory allocation).

asked Feb 7 in Computer Science - IT by Aqib Muhammed | 24 views

1 Answer

0 votes
If you add inline keyword before a function it becomes inline

It is said that Inline functions can help optimize execution time.

Difference between normal & inline :

In case of inline : compiler replaces the function call statement with the function code itself (process called expansion) and then compiles the entire code

If Still unclear please check following image to make things a bit easy :

image

Pic Credit

There are several articles explaining the concept, but i would suggest following ones, please go through:

CPP Article

ISO CPP

Fav. StackOverflow

Thanks


answered Feb 7 by techdoubt