1) I don't understand what do you mean by this, but lines starting with // are not included in compilation and they are ignored, these are just comments used to comment out codes and enable the reader to understand what is going on, in English.
2) Every program needs a main() function whether int or void type, basically you can't run a program without it.
3) The ! operator is the boolean change operator, basically it changes a bool value from false if it is true and true if it is false, in other words it flips the value of the bool, if(!performsrchrandom) means if the function "performsrchrandom" which is a bool type function returns false, do the following code.