Can we call any function before main function is called?
There is no portable way to do that. Few compiles provide extensions to designate a different function as start-up function, but thats not standard and portable( For Example: Turbo C provides #pragma startup directive), but its not standard and hence not a portable method. And in freestanding environments like embedded systems, any function can be made as start-up function, there is no requirement for main to be start-up function in such environments.