I have 2 files that interact with each other. I would like to define an enum to make the code more readable, but if I define it in file 1, file 2 complains that it does not know about this enum. If I define ii in file 2, file 1 does the same. I define him as an audience too.
The solution was to define the enumeration in both files, but this does not seem right to me. This is not only redundant, but I am afraid that this may cause some conflict, even if the types have the same elements.
What is the verdict on this? Am I doing something wrong or too worried?
EDIT
Well, given the comments here, I found an alternative that seems to do what I want without creating a new file. I have had:
file 1
class myClass1
{
public enum MyEnum
{
...
}
...
}
file 2
class myClass2
{
public enum MyEnum
{
...
}
....
}
Now I have:
file 1
enum myEnum
{
...
}
...
class myClass1
{
...
}
file 2
class myClass2
{
...
}
, . , , , .
prinny