UMBC CMSC 201
CSEE | 201 | 201 F'06 | lectures | news | help
The function scanf() is analogous to printf() in that it has a "format string" and a set of variables, one for each code in the "format string.
scanf("%d", &n) ; scanf("%d%d", &n, &m) ;Of course, it reads from the standard input rather than writing to the standard output.
The function scanf takes pointers to variables as parameters (parameters passed by reference) so it can store the user's input in those variables.