Global array

H. S. Teoh via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Dec 11 13:33:35 PST 2014


On Thu, Dec 11, 2014 at 08:56:00PM +0000, Paul via Digitalmars-d-learn wrote:
> Is there any merit (or folly!) in storing a large array, that
> frequently needs to be accessed globally, within a class like so:
> 
> public class classMap{
> 	
> 	public static int[MAPSIZE][MAPSIZE] map;
> 
> }
> 
> Or is there a proper 'D' way to do this?
[...]

Why do you need to wrap it inside a class? Why not just put it in
module-global scope, since it's public anyway?


T

-- 
May you live all the days of your life. -- Jonathan Swift


More information about the Digitalmars-d-learn mailing list