PDA

Click to See Complete Forum and Search --> : stdin?


Help
Feb 6th, 2001, 03:51 PM
Hello
Can someone tell me what this is doing?
What does the stdin do?


{
fgets(line, sizeof(line), stdin);
sscanf(line, "%d",&num1);
}

Thanks :)

Cybrg641
Feb 6th, 2001, 04:12 PM
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?