Thread: HEX and BCD coded file READING !!

  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,490
    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