Thread: quick fscanf question

  1. #1
    Registered User
    Join Date
    Mar 2005

    quick fscanf question

    Hi -

    Just trying to read in strings from a file and I'm coming across a problem. In the file I have


    And I want to miss out the Filenames and just read the triangle.txt but I've forgotton how to tell the program to skip that bit of text. I was trying to just add \n but it didnt like that at all.

    Any ideas??



  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    So read the first line and discard it. Then continue on your merry way.

    Hope is the first step on the road to disappointment.

  3. #3
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    You can do it with a single fgets():
    char s[SIZE];
    fgets(s, sizeof(s), fp);

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell

    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ:

    My website:
    Projects: codeform, xuni, atlantis, nort, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. quick question (adding characters)
    By Cactus in forum C Programming
    Replies: 2
    Last Post: 09-24-2005, 03:54 PM
  2. very quick question.
    By Unregistered in forum C++ Programming
    Replies: 7
    Last Post: 07-24-2002, 03:48 AM
  3. quick question
    By Unregistered in forum C++ Programming
    Replies: 5
    Last Post: 07-22-2002, 04:44 AM
  4. Quick Question Regarding Pointers
    By charash in forum C++ Programming
    Replies: 4
    Last Post: 05-04-2002, 11:04 AM
  5. Quick question: exit();
    By Cheeze-It in forum C Programming
    Replies: 6
    Last Post: 08-15-2001, 05:46 PM
Website Security Test