19
In c++, cin is the stdin input stream. There is no input stream in C, but there is a file object, called stdin. You can read from it using a lot of ways, but here's an example from cplusplus.com:
/* fgets example */
#include <stdio.h>
int main()
{
char buffer[256];
printf ("Insert your full address: ");
if (fgets(buffer, 256, stdin) != NULL) {
printf ("Your address is: %s\n", buffer);
}
else {
printf ("Error reading from stdin!\n");
}
return 0;
}
UPDATE
I've changed it to use fgets, which is much simpler since you have to worry about how large your buffer is. If you also want to parse the input use scanf, but make sure that you use the width attribute.