Personal Message (Online)
Re: How does define work?
« Reply #2 on: Today at 11:26:34 »
Bigger Bigger Smaller Smaller Reset Reset Reply with quoteQuote Modify messageModify Remove messageRemove Split TopicSplit Topic
Try forcing an integer size:Code:
#define alt 10000UL
That will define "alt" as being an unsigned long value of 10,000.
This is why it is generally better to use "const" for numeric values instead of #define as you specify a data type for the compiler to work with:
Code:
const unsigned long alt 10000;
But slip in an assignment, to keep the compiler happy.