Řešení:

Chybělo str_cln[j] = '\0'. Vše už vyřešeno.

Jsou zobrazeny jen nové odpovědi. Zobrazit všechny
Předmět Autor Datum
IMHO by to mělo ten sin ukončit nulou (a velikost by měla sedět (100+'\0'=101) • An optional decimal… nový
gilhad 30.10.2021 23:15
gilhad
Chybělo str_cln[j] = '\0'. Vše už vyřešeno. poslední
nic5 31.10.2021 10:00
nic5

IMHO by to mělo ten sin ukončit nulou (a velikost by měla sedět (100+'\0'=101)
• An optional decimal integer which specifies the maximum field width. Reading of characters stops either when this maximum is reached or when a nonmatching character is found, whichever happens first. Most conversions discard initial white space charac‐
ters (the exceptions are noted below), and these discarded characters don't count toward the maximum field width. String input conversions store a terminating null byte ('\0') to mark the end of the input; the maximum field width does not include this
terminator.

Ale netestuješ tam návratovou hodnotu toho scanf (měla by být 1 protože hledáš právě 1 výraz).

Zkoušel jsem to, ale nějak se mi nepodařilo tu chybu navodit, nebo jsem něco přehlédnul...

Zpět do poradny Odpovědět na původní otázku Nahoru