probelms with fscanf()

This is a discussion on probelms with fscanf() within the C Programming forums, part of the General Programming Boards category; I am have problems of using fscanf(). I am trying to assign letters/numbers from a file into different variables. How ...

  1. #1
    Registered User
    Join Date
    Jan 2003
    Posts
    14

    Unhappy probelms with fscanf()

    I am have problems of using fscanf(). I am trying to assign letters/numbers from a file into different variables. How do I do it?
    I read about fscanf() in other sites, but couldn't understand what the author is trying to say. Help please?

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Post some code.

    And maybe some of these will help you.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  3. #3
    Registered User
    Join Date
    Jan 2003
    Posts
    14
    I know I am suppose to use something like a loop :
    Code:
    FILE *f;
    f=fopen(/*target of file*/,"r");
    while(!feof(f))
    {
    /*
     something over here (Need help here I think)
    */
    }
    I think that is the right part of the code.. I should put the fscanf().
    So where do I put it and How should I do it, and How does it work?
    (I think another one would be getc() I think (?))

  4. #4
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Read through the links I gave you, and also this one.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  5. #5
    Registered User
    Join Date
    Jan 2003
    Posts
    14

    Post

    alright..

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. fscanf causes a SEGMENTATION FAULT
    By yougene in forum C Programming
    Replies: 15
    Last Post: 12-28-2008, 11:11 PM
  2. fscanf in different functions for the same file
    By bchan90 in forum C Programming
    Replies: 5
    Last Post: 12-03-2008, 08:31 PM
  3. fscanf causing a crash
    By dougwilliams in forum C Programming
    Replies: 6
    Last Post: 11-18-2007, 03:52 PM
  4. fscanf help
    By Axel in forum C Programming
    Replies: 13
    Last Post: 10-22-2006, 10:44 PM
  5. fscanf on sun's
    By brif in forum C Programming
    Replies: 2
    Last Post: 04-14-2002, 01:22 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21