+2 votes

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 :


Pic Credit

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

CPP Article


Fav. StackOverflow


answered Feb 7 by techdoubt