Mail Archives: djgpp/1999/08/11/06:56:57
Quoting libc's documentation,
"(...) `printf' cannot print a value of type `uclock_t', even though
it is an integer value, because it is a 64-bit integer."
So I thought of using libg++'s Integer class to print this 64-bit integer
and wrote this piece of code:
#include <allegro.h>
#include <time.h>
#include <stdio.h>
#include <integer.h>
int main()
{
allegro_init();
install_keyboard();
uclock();
Integer i;
while(!key[KEY_ESC])
{
i = uclock();
cout << i << endl;
}
return 0;
}
However, the first lines of output were:
25
2317
4860
7466
10050
12645
15236
-47579
-45450
-42852
-40260
-37660
-35064
-32469
-30044
-27873
-25200
-22602
Why is it printing negative values?
Do you know another way of printing an uclock_t?
----------------------------
Thiago
- Raw text -