<P> No matter what the datatype the programmer wants the program to read, the arguments (such as &n above) must be pointers pointing to memory . Otherwise, the function will not perform correctly because it will be attempting to overwrite the wrong sections of memory, rather than pointing to the memory location of the variable you are attempting to get input for . </P> <P> In the last example an address - of operator (&) is not used for the argument: as word is the name of an array of char, as such it is (in all contexts in which it evaluates to an address) equivalent to a pointer to the first element of the array . While the expression &word would numerically evaluate to the same value, semantically it has an entirely different meaning in that it stands for the address of the whole array rather than an element of it . This fact needs to be kept in mind when assigning scanf output to strings . </P> <P> As scanf is designated to read only from standard input, many programming languages with interfaces, such as PHP, have derivatives such as sscanf and fscanf but not scanf itself . </P> <P> The formatting placeholders in scanf are more or less the same as that in printf, its reverse function . </P>

When does the c input function scanf() stop reading input for a string conversion specifier