Thread: fscanf and new lines

  1. #1
    Registered User
    Join Date
    May 2004

    fscanf and new lines


    Is it possible to manually change line when using fscanf?
    sort of like this:


    And how doest he pointer work, will it point to the first element in my file and then be incremented? If yes, can i manually increment it (inputFilePtr+something)?

    What I want to do is to read the first character in a line, if it is a # it is a comment and I will discard that line. Hence my wish to change the line


    p.s Is there somewhere where I can look up all the things I can do with a command (as fscanf) so I don't have to ask people all the time.

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Consider this FAQ entry on how to read a line. You're best served useing fgets, and after testing the first character, if you want to use the line, use [color=blue]sscanf[/url] to extract what you need.

    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed
Website Security Test