What is it that you are trying to do ?.
I am trying to get data from loop() function, and analyze that acquired data in a separate function(self made), and show the output in serial monitor.
As my analysis is dependent on the complete data acquired by loop() function, I cannot call my separate self made function from the loop() function.
And as the setup() function is executed before the loop() function, I cannot call my self made function from setup() function because before entering the loop() function, I have no data to work with.
Thus I need a separate function for the analysis part.
I did not know about the main() method you suggested, that would solve all of my issues if the setup() and loop() functions can be completely avoided.