Is it possible to redefine a C# keyword like int
to use Int64 instead of Int32?
If not, how can one do this? I want to have the flexibility to redefine the int I use, so later I could change it to int64 if I wanted, instead of going around to replace all the int values manually.
No it's not possible and you really should not be doing this. Redefining keywords to custom values will only serve to make your code less readable and maintainable. People getting introduced to your code base would have to forget everything they know about C# defaults and learn your defaults. This is not a good way to make a maintainable code base.
What you should consider though is creating a new type name and using a "using alias" to redirect that type within your code base.
using FexibleInt = System.Int32;
Add
using MyIntType = System.Int64;
after the namespace
declaration.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With