1.

Can We Specify Variable Field Width In A Scanf() Format String? If Possible How?

Answer»
  • It is possible to specify variable field WIDTH in a scanf() format string by using %s control string.
  • The %s reads a string of variable field width up to the first white space character.

Example:

scanf("%s", name); // where name is a character array

  • The scanf() stores the results AWAY in variables which you PROVIDE in the argument list and reads the DATA from the CONSOLE or from a FILE stream and parses it.

Example:

scanf("%s", name); // where name is a character array



Discussion

No Comment Found