Need some help with file i/o

This is a discussion on Need some help with file i/o within the C Programming forums, part of the General Programming Boards category; I will be dealing with unsigned long long ints as an array of type char[8]. I need it to skip ...

  1. #1
    Registered User
    Join Date
    Nov 2011
    Posts
    150

    Need some help with file i/o

    I will be dealing with unsigned long long ints as an array of type char[8]. I need it to skip 0-5 as these are reserved characters. After the first 0-5 skip every 0 and mark it with a 1 to mean write out the next 8 bytes(9 bytes total are written). Example if this is fread : 09842658 then output will be :109842658 But if the first number is not a 0 then proceed to encode it: output = 98042658 = 6 and I need it to add a digit to the encode every time it gets to a new power of two, example if the last two chars in the array and skipping over the zeros of the first six: (array element 0,0,0,0,0,0,10)then output = 07 How could I go about this? I do not know what I am doing, I read a lot and thought I knew how to go about this but started to write code and had writer's block. I just can't seem to be able to start coding this and I don't know how to do this. Thank you.

  2. #2
    Registered User
    Join Date
    Nov 2011
    Posts
    150
    And encode on every +=2

  3. #3
    Registered User
    Join Date
    Nov 2011
    Posts
    150
    so that every even number from that starting point will be encoded.

  4. #4
    Stoned Witch Barney McGrew's Avatar
    Join Date
    Oct 2012
    Location
    astaylea
    Posts
    420
    I will be dealing with unsigned long long ints as an array of type char[8].
    Those types are incompatible. What do you mean?

  5. #5
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    You need to back up, maybe take a deep breath, and describe WHAT you're trying to do here. S-L-O-W-L-Y and carefully explain it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 11-28-2012, 08:16 AM
  2. Replies: 11
    Last Post: 09-25-2011, 12:22 AM
  3. Replies: 3
    Last Post: 11-21-2006, 06:26 PM
  4. Replies: 4
    Last Post: 07-06-2006, 02:53 AM
  5. Replies: 12
    Last Post: 03-10-2005, 06:48 PM

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