[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: scanf for long exadecimal numbers
From: |
Mike Miller |
Subject: |
Re: scanf for long exadecimal numbers |
Date: |
Mon, 27 Jan 2014 20:11:59 -0500 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Mon, Jan 27, 2014 at 17:37:40 +0100, Francesco Potortì wrote:
> I have an ascii input file with long hex numbers (longer than 32 bits)
> which come from javascript dates (milliseconds from 1970-01-01T00:00:00).
>
> I have not found a way to read them using fscanf :(
The following works for me on a 64-bit system:
values = fscanf (fid, "%lx");
but I get an empty result on a 32-bit system when the numbers are wider
than 32 bits (hex strings longer than 8 digits):
values = [](0x1)
If that's what you're seeing, have you tried reading in strings and
converting with hex2dec?
--
mike