HEX and BCD coded file READING !!

This is a discussion on HEX and BCD coded file READING !! within the C Programming forums, part of the General Programming Boards category; Dear Friend, Can some one tell me how to read ... HEX and BCD word from a single file ... ...

  1. #1
    Registered User
    Join Date
    Jun 2002
    Posts
    19

    HEX and BCD coded file READING !!

    Dear Friend,

    Can some one tell me how to read ... HEX and BCD word from a single file ... what is the best link to find out how to convert the ASCII file to similar thing ....

    with best regards
    Mehul Doshi

  2. #2
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,493
    for hex:
    you might be able to use a union between a 2 char array and a short int, read in two chars and place them in the array, and the answers in the short int.

    in the case of bcd:
    read in two chars. multiply the second one by ten and add to the first one.

  3. #3
    Registered User
    Join Date
    May 2002
    Posts
    85
    Read them as a string from a file, then parse them
    as whatever you intend to do with them.

    DV007

Popular pages Recent additions subscribe to a feed

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