CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Hexadecimal

  1. #1
    Join Date
    Mar 2003
    Location
    croatia
    Posts
    1

    Unhappy Hexadecimal

    Please,can anybody help me!?I need to write a program which will
    find hexadecimal numbers in a file.Hexadecimal number begin with
    0x,they have 2 characters in hexadecimal code.Every hexadecimal
    number write on screen with decimal equivalent.

    example:
    in file: 0x10 0xVV 0xfe 0x 0A
    on screen:
    hex dec
    10 16
    VV error
    fe 254
    0A 10
    Thanks!

  2. #2
    Join Date
    Feb 2002
    Posts
    5,757
    Here is one algorithm.

    -Open file
    -*loop through every line
    -token spaces and store data segment to map temporary value
    -loop through container and validate hex, convert to dec, and store in value

    *There are other solutions including file-mapping.

    Kuphryn

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured