www.digitalmars.com         C & C++   DMDScript  

c++.dos - printf and "long long"

reply "John Lance" <JDLance prodigy.net> writes:
Could someone tell me how to printf the long long int's (64 bit).
I've looked for the docs on it and maybe I've missed it.

I've got a utility I am writing where I need to report on files larger than
4 Gig and some of the numbers I am keeping track of can easily exceed
unsigned longs.

Thanks!

John D. Lance
JDLance prodigy.net
Jul 24 2002
parent reply "Nic Tiger" <nictiger pt.comcor.ru> writes:
To print long long (64-bit integer) use %lld or %llu.
But since you posted this in DOS thread, I doubt that you can have files
larger than 2Gb in DOS. Can you?

Nic Tiger.

"John Lance" <JDLance prodigy.net> wrote in message
news:ahnr5o$1aml$1 digitaldaemon.com...
 Could someone tell me how to printf the long long int's (64 bit).
 I've looked for the docs on it and maybe I've missed it.

 I've got a utility I am writing where I need to report on files larger
than
 4 Gig and some of the numbers I am keeping track of can easily exceed
 unsigned longs.

 Thanks!

 John D. Lance
 JDLance prodigy.net
Jul 25 2002
next sibling parent "Walter" <walter digitalmars.com> writes:
Also, the 64 bit long long type is not implemented for 16 bit models; just
32 bit models.

"Nic Tiger" <nictiger pt.comcor.ru> wrote in message
news:ahog45$246f$1 digitaldaemon.com...
 To print long long (64-bit integer) use %lld or %llu.
 But since you posted this in DOS thread, I doubt that you can have files
 larger than 2Gb in DOS. Can you?
Jul 25 2002
prev sibling parent reply "John Lance" <JDLance prodigy.net> writes:
You're quite correct.  I posted to the wrong group.

Thanks to those replying for all for the info though.

I am using Windows Console mode for the utility.

Since I am here....  I did notice that those long long's hog the processor
(and probably the general machine architecture) a whole lot more than I was
hoping for.

The program execution speed dropped quite noticeably from just using
unsigned longs.

I am not so up on the processor architecture as I should be at the moment.
Don't the Pentium III's have 64 bit wide registers anywhere in their
construction that the compiler is able to use for register variables?  I
know it is basically a 32 bit device, but can't some registers can be
"grouped" where they would be used and act as 64 bit registers instead of
2 - 32 bit registers?

The performance hit was enough to consider two versions of the utility.

Thanks again, and Walter, YOU'RE THE MAN.  I can't tell you how happy I was
to see that this product is still going forward.  I first came across it as
Symantec C++ version 7.5 and I loved the ease of use and overall speed(s)
and configurability of the product.

John Lance
JDLance prodigy.net
Jul 25 2002
parent "Walter" <walter digitalmars.com> writes:
"John Lance" <JDLance prodigy.net> wrote in message
news:ahqosr$1ibq$1 digitaldaemon.com...
 I am not so up on the processor architecture as I should be at the moment.
 Don't the Pentium III's have 64 bit wide registers anywhere in their
 construction that the compiler is able to use for register variables?  I
 know it is basically a 32 bit device, but can't some registers can be
 "grouped" where they would be used and act as 64 bit registers instead of
 2 - 32 bit registers?
No, not that I've found <g>.
 Thanks again, and Walter, YOU'RE THE MAN.  I can't tell you how happy I
was
 to see that this product is still going forward.  I first came across it
as
 Symantec C++ version 7.5 and I loved the ease of use and overall speed(s)
 and configurability of the product.
Thanks!
Jul 26 2002