I have made a C program to log some data.
I get a timestamp in uint32_t format.
I then saved the data using afprintf("%d",timestamp) this means that it made a cast from the unsigned integer to an signed integer, and therefore i got some numbers which are way of.
My question is then. how do i compute it back to the original unsigned integer. preferable in a c# program. but anything will do.
Asked
Active
Viewed 213 times
0

arsaKasra
- 179
- 1
- 3
- 10

pjensen68321
- 521
- 1
- 5
- 15
-
So, you just need to read a file? – Ivan Aksamentov - Drop Oct 10 '13 at 13:20
1 Answers
1
why not save it with fprintf("%u",timestamp) which is meant for unsigned ints?
but casting in general is done like this:
unsigned int a;
int b = -1;
a = (unsigned int )b; // a should now be 4294967295

NiRR
- 4,782
- 5
- 32
- 60