I used following code to provide a global variable.
namespace STR.Pref
{
public static class Pref
{
public static Lang PrimaryLang { get; set; } = Lang.Sinhala;
public static bool InsTrans { get; set; } = true;
public static HotKey Key { get; set; } = new HotKey();
}
}
So I can use following code to assign value to that global variable (any file).(without instantiating)
private static void SetValue(Pref_tempObj tempObj)
{
Pref.Pref.Key = tempObj.Key;
Pref.Pref.InsTrans = tempObj.InsTrans;
Pref.Pref.PrimaryLang = tempObj.PrimaryLang;
}
The program works perfectly,But recently I was interested in c++ so I made a decision to write that program in c++/clr with the small update. I'm bit new to c++ and I don't understand how can I accomplish this using c++.(whether using pointer or something else)