I can't seem to print out the value of a.
unsigned long int a;
//other code that assigns a value to a.
printf("%lu\n",a);
for some reason it just prints the "u" instead of a.
Is the msp430 different than regular c with this?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I can't seem to print out the value of a.
unsigned long int a;
//other code that assigns a value to a.
printf("%lu\n",a);
for some reason it just prints the "u" instead of a.
Is the msp430 different than regular c with this?
For size reasons, there are different levels of printf support. The smallest one AFAIK just ignores any format specifier (the '%' and the following letter). Others implement more or less of the full feature set.
This can be configured in the project settings.
This has nothing to do with MSP430. The printf implementation is a plain compiler-specific thing. A different compiler (and there are at tlest three I know of) may handle it differently.Andrew Noble said:Is the msp430 different than regular c with this?
**Attention** This is a public forum