'What will be the run time if a function is defined inside a program but is not called in main function?

I am doing all my assignments in a single .c file by writing functions, but now it seems that it affects the run time. Does it mean that if I do not call a function but define it then the function is also compiled and hence it slows down the program?

c


Solution 1:[1]

No. The only thing it affects is compile and link time and to some degree startup/load time (becauese of larger binary)

Most compilers will strip (i.e. remove) unused code when optimizations are turned on.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Raildex