 <p>I suppose <a href="http://en.wikipedia.org/wiki/Singleton_pattern" rel="nofollow">Singleton</a> should help you managing it better, so you dont have to pass the pointer around. Practically, <code>mpi_glob</code> does the same, <code>Singleton</code> is just more accustomed way.</p> <p>Alternatively, you can still resort to global variables - they are not bad as such. If you want to emphasize one-time assignment you can declare them <code>const</code> and set them via static initializer like this:</p> <pre><code>const int number_of_tasks = get_preconfigured_number_of_tasks(); </code></pre> <p>If your global variables are used to hold compile time constants, then it is perfectly fine to replace them with <code>enum</code> members or preprocessor defines. Doing so will ease up on compiler, because it can use immediate value in-place without memory access.</p> <hr> <p>Credit goes to Pete Becker for pointing Singleton issues in his comment. If those issues bother you too, then totally different approach can be taken.</p> <p>Remember how Java programs are implemented? There is main class with main method and all program's work runs from inside that main method. Main is still member function, i.e. it can exclusively access some private fields of the main class (they have to be static in case of Java, but this is not the main point here).</p> <p>We can further extend the concept to <a href="http://en.wikipedia.org/wiki/Command_pattern" rel="nofollow">Command</a>-like implementation. The difference with conventional Java is that your main method equivalent is not static and your global variables with values specific to contained program are non-static member variables. All functions that need access to global state data are to be converted into member functions. This is possible, because main method is also member function.</p> <p>This way, I think, you can achieve better encapsulation and data safety.</p>