- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Suppose you have an 5-digit integer variable and read into it the following: 03928
Immediately after the read, the variable appears to contain '3928'.
Later, this same variable is written out via format i5, and it appears as '_3928' (the leading zero has disappeared).
If the original value is replaced by '13028', it reads and writes exactly as expected, i.e., all 5 digits are preserved.
If I handled this as a character, I could manage this issue. But handling it as an integer, why does the compiler appear to swallow the leading zero in the 5-digit integer? Is there an easy way to preserve it?
Link kopiert
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Instead of i5 format use I5.5 which always outputs 5 digits padded with leading zero's
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Thanks app4619. I was thinking about ix.x - I've used this before for what I thought were other purposes. It didn't dawn on me that it was applicable here.

- RSS-Feed abonnieren
- Thema als neu kennzeichnen
- Thema als gelesen kennzeichnen
- Diesen Thema für aktuellen Benutzer floaten
- Lesezeichen
- Abonnieren
- Drucker-Anzeigeseite