Thread: Program skips fgets, can't find out why

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Sep 2018
    Posts
    4

    Exclamation Program skips fgets, can't find out why

    So, There isn't exactly too much to explain here. I'm building this one program that's eventually going to take flash card terms, wrtie and read them into a file, and then let you guess the word of the definition.

    I'm not even done making the part that writes the terms into the struct, and I've gotten a problem.

    When it gets to asking what the first definition is, it skips over my fgets() command that would be the answer, and asks what the word is for this definition. I try commenting out the first if statement, and it does this for the second function. I tried isolating the first if statements into their own little program, and it works fine in there, which would point to it being a problem with the main program, but I can't seem to find an error there either.

    I should mention I wrote all 50 of the if statements that save into the struct using a bash script I whipped up in command prompt, but I don't think thats the issue, because all the other ones work fine.

    Any help would be appreciated!
    Attached Files Attached Files

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. my program skips the second scanf. pls help!
    By aske10 in forum C Programming
    Replies: 5
    Last Post: 01-08-2016, 03:39 AM
  2. Program skips scanf
    By nic050 in forum C Programming
    Replies: 2
    Last Post: 06-05-2015, 10:54 PM
  3. fgets after scanf, skips over fgets?
    By willane1965 in forum C Programming
    Replies: 1
    Last Post: 08-17-2014, 11:13 PM
  4. fgets prompt in while loop "skips"
    By Jesdisciple in forum C Programming
    Replies: 16
    Last Post: 04-12-2009, 06:55 PM
  5. program skips over code
    By willc0de4food in forum C Programming
    Replies: 9
    Last Post: 11-16-2006, 06:38 PM

Tags for this Thread