Skipping some bytes from a file

This is a discussion on Skipping some bytes from a file within the C Programming forums, part of the General Programming Boards category; Hi, I am looking for functions that enable me to skip some bytes from a file with certain long, and ...

  1. #1
    Registered User
    Join Date
    Jun 2006
    Posts
    130

    Skipping some bytes from a file

    Hi,

    I am looking for functions that enable me to skip some bytes from a file with certain long, and then put the Chars after that:

    skip(some bytes)
    putchar(the (chars)bytes after that)

    10 00 00 30 00 34 10 00 00 30 00 34
    skip skip skip (put----------) skip skip skip (put----------) .. and so on

    If some functions exist for that purpose:

    I want to know if skip() function going to cont traversing the bytes, I mean is the last postion that the skip() stopped in going to be kept or not

    Hope my question is clear

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,548
    Look up fseek() in your manual.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Been here, done that.
    Join Date
    May 2003
    Posts
    1,161
    Just input the byte and do nothing with it to skip.
    Code:
    fgetc();  // skip
    fgetc();  // skip
    fgetc();  // skip
    fgetc();  // do somthing
    processCharacter()
    fgetc();  // skip
    fgetc();  // skip
    fgetc();  // skip
    fgetc();  // do somthing
    processCharacter()
    fgetc();  // skip
    Definition: Politics -- Latin, from
    poly meaning many and
    tics meaning blood sucking parasites
    -- Tom Smothers

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Reverse Engineering on a Download file
    By c_geek in forum C Programming
    Replies: 1
    Last Post: 03-22-2008, 03:15 PM
  2. strcat - cannot convert char to const char
    By ulillillia in forum C Programming
    Replies: 14
    Last Post: 12-07-2006, 09:00 AM
  3. Replies: 3
    Last Post: 03-04-2005, 01:46 PM
  4. Possible circular definition with singleton objects
    By techrolla in forum C++ Programming
    Replies: 3
    Last Post: 12-26-2004, 09:46 AM
  5. Need a suggestion on a school project..
    By Screwz Luse in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 01:58 AM

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