Results 1 to 2 of 2

Thread: stdin?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Posts
    143
    Hello
    Can someone tell me what this is doing?
    What does the stdin do?
    Code:
    {
    fgets(line, sizeof(line), stdin);
    sscanf(line, "%d",&num1);
    }
    Thanks

  2. #2
    Lively Member
    Join Date
    Jun 2000
    Posts
    122
    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width