|
|
Text Input - scanf |
|
#include <stdio.h>
int scanf(const char *format, ...);
Syntax is very similar to printf
(see man 3 scanf for more information).
stdio.h)
Syntax: scanf (<format>, var1, var2, ...);
Example format codes
scanf by reference
so the value can be modified by the function
int i; float f; printf ( "Enter an integer and a float: " ); scanf ( "%d %f", &i, &f );