Hello
Can someone tell me what this is doing?
What does the stdin do?
Thanks :)Code:
{
fgets(line, sizeof(line), stdin);
sscanf(line, "%d",&num1);
}
Printable View
Hello
Can someone tell me what this is doing?
What does the stdin do?
Thanks :)Code:
{
fgets(line, sizeof(line), stdin);
sscanf(line, "%d",&num1);
}
stdin reads characters from the keyboard. So in that code, fgets reads the characters from the keyboard and puts it into the variable "line". Then "sscanf" function then converts "line" into an integer. Does that help?