I am (student) just switched to linux working on NoC (noxim) simulator in ubuntu 12.04 c++ is supported assignment from university, I want to make a script that call my whole program multiple times (for loop= e.g 10) and want to take average value from the functions that were called from other files. Should I create a new file for script? if yes then which header files should I call in that.

and how to create log file of the above mentioned output, if simulation takes hours. I want for each iteration the value is saved and in the end whole output is declared as an array or string.

Need Help in this, help me as soon as possible if there is any error so I can discuss with you people.