No, what you are dealing with is a discipline type problem known as structural equivalence and name equivalence. As Dog said, the closest thing you could do to achieve what you want is to use structures, but it can be a waste of memory if the compiler decides to add an add-on (which is unlikely in this case). C uses structural equivalence (which means the two types are the same) for aliases, but name equivalence for different declared structures (two types of structures with the same layout are not considered equivalent).
An example of using structures for this:
typedef struct { double value; } meters; typedef struct { double value; } kilograms; int main(){ meters m; kilograms k = {2};
You can read this article: http://www.joelonsoftware.com/articles/Wrong.html , describing how you can avoid these problems with naming conventions
Ryan haining
source share