1
13 Fallen
Hello,
This is a newbie question.
There are two ways I have handled shared constants in C and in VB:
* a header (H) file in C that is shared by one or many projects
* a module (BAS) file in VB that is shared by one or many projects
These constants are usually special strings and special numbers that need to
be shared across a family of applicaitons.
I understand that I cannot put constants inside an empty C# (CS) source
file, although they can be placed inside a class or struct definition inside
a namespace.
Is it always better programming practice to have constants always associated
with a class or struct?
Can I use a namespace and abstract class to hold global constants?
Thanks,
-G
This is a newbie question.
There are two ways I have handled shared constants in C and in VB:
* a header (H) file in C that is shared by one or many projects
* a module (BAS) file in VB that is shared by one or many projects
These constants are usually special strings and special numbers that need to
be shared across a family of applicaitons.
I understand that I cannot put constants inside an empty C# (CS) source
file, although they can be placed inside a class or struct definition inside
a namespace.
Is it always better programming practice to have constants always associated
with a class or struct?
Can I use a namespace and abstract class to hold global constants?
Thanks,
-G