Is it possible to override a C # keyword, such as int , to use Int64 instead of Int32?
int
If not, how can this be done? I want the flexibility to override the int I use, so later I could change it to int64 if I wanted, instead of going around all the int values โโmanually.
No, this is not possible, and you really should not do it. Overriding keywords for custom values โโwill only make your code less readable and maintainable. People familiar with your code base will have to forget everything they know about C # defaults and find out their defaults. This is not a good way to create a supported code base.
What you should consider is creating a new type name and using "use an alias" to redirect that type inside your code base.
using FexibleInt = System.Int32;
Add
using MyIntType = System.Int64;
after the namespace declaration.
namespace
Sorry - this cannot be done with C # unless you put all your files through a preprocessor before compiling them.
I do not think so. Are you trying to use the same functionality as typedef in C ++?
One thing you can do is encapsulate an int in a user defined class / struct.
or