Formatted Input
scanf(format_str, pt1, pt2,…) read from standard input.
fscanf(fp, format_str, pt1, pt2, …) read from a file
sscanf(str, format_str, pt1, pt2, …) read from a string str.
- Where format_str is a string containing descriptor %code, the conversion code can be d (for integer), c (for character), s (for string), f (for floating point number), etc.
- pt1, pt2, …, are pointers (addresses) associated with each format descriptor.
- fp is file pointer.