Hello All,
I want to print the character '%' in sprintf. How can I achieve this?
friendly regards
Ellen
sprintf(s,"PV %dWh P %dWh b %dA %d%", (int)SumPv, (int)SumLinePowerBat, (int)Charge_DischargePowerTotal, PercentBatCap);
the output should be at the last item: 45%. The compiler ignores the last char and gives me this warning:
Severity |
Code |
Description |
Project |
File |
Line |
Warning |
|
spurious trailing '%' in format [-Wformat=] |
SolarmonV02 |
C:\Users\User2\Documents\Atmel Studio\7.0\Solarmon\SolarmonV02\Utils.c
|
138 |