After many years of reading on this site (and getting many helpful solutions), it's time for me to ask a question:)
I was wondering about the default enum values. I'm using enums to send error codes from an MCU to a PC (and vice versa)
is it a good practice (and safe) to define enums like this
C:
typedef enum
{
no_error = 0,
error_1
error_2,
...
}
C#
enum
{
no_error = 0,
error_1,
error_2,
}
All enum values are cast into Uint32
before Transfer.
Can I always assume that error_1 = 1
and error_2=2
on C and C# side?
I'm using the GCC Compiler.