UMBC CS 201, Fall 05
UMBC CMSC 201 Fall '05
CSEE | 201 | 201 F'05 | lectures | news | help


You have been using the function scanf from the stdio library since the beginning of this course, but I have been sheilding you from scanf's peculiarities by providing specific kinds of input.

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.

CSEE | 201 | 201 F'05 | lectures | news | help

Monday, 26-Sep-2005 11:20:21 EDT