in C Plus Plus by
Q:
Can we specify variable field width in a scanf() format string in C Language? If possible how in C Language?

1 Answer

0 votes
by
All field widths are variable with scanf(). You can specify a maximum field width for a

given

field by placing an integer value between the =%‘ and the field type specifier. (e.g. %64s). Such a

specifier will still accept a narrower field width.

The one exception is %#c (where # is an integer). This reads EXACTLY # characters, and it is

the

only way to specify a fixed field width with scanf().
Click here to read more about Loan/Mortgage
Click here to read more about Insurance

Related questions

0 votes
asked Mar 12, 2020 in C Plus Plus by rahuljain1
0 votes
asked Jun 11, 2020 in C Plus Plus by Robindeniel
0 votes
asked Mar 17, 2020 in C Plus Plus by SakshiSharma
0 votes
asked Jun 22, 2019 in PHP by SakshiSharma
0 votes
asked Mar 17, 2020 in C Plus Plus by rajeshsharma
...