What does "%8" mean?

Asked 2 years ago, Updated 2 years ago, 44 views

There's a question like this char z[9];

printf("%s", "Enter string:");
scanf("%8[^aeiou]", z);

printf("The input was \"%s\"\n", z);

What does %8[aeiou] mean?

aeiou>is

c

2022-09-22 08:06

1 Answers

where %8 means the maximum length of data to be entered. Other than that, no matter how much data is entered, we politely ignore it. For example, entering the string "1234567890" will result in "12345678".

If you look at https://modoocode.com/36, you will understand the scanf function better.


2022-09-22 08:06

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.