Next: Whole Line Input Up: Input and Output Previous: Formatted Input Output

Formatted Input Output with Strings

These are the third set of the printf and scanf families. They are called sprintf and sscanf.

puts formatted data into a string which must have sufficient space allocated to hold it. This can be done by declaring it as an array of char. The data is formatted according to a control string of the same form as that for p rintf.
takes data from a string and stores it in other variables as specified by the control string. This is done in the same way that scanf reads input data into variables. sscanf is very useful for converting strings into numeric v values.
Tue Jan 17 11:40:37 GMT 1995