www.digitalmars.com         C & C++   DMDScript  

D - Problem with printf

reply dick <dick_member pathlink.com> writes:
printf seems to have a problem handling long(s) in Beta 0.69
e.g.
printf("%ld, %ld\n",100L,200L);
results in 100,0

Interesting enough
printf("%ld,%ld,%ld\n",100L,200L);
results in 100,0,200

if the values of 100 and 200 were just plain int(s) things work just fine
Aug 26 2003
parent "Matthew Wilson" <matthew stlsoft.org> writes:
you need to use %lld, since longs in D are 64-bits. %ld is DMC++'s long,
i.e. 32-bits

"dick" <dick_member pathlink.com> wrote in message
news:bigue4$k9n$1 digitaldaemon.com...
 printf seems to have a problem handling long(s) in Beta 0.69
 e.g.
 printf("%ld, %ld\n",100L,200L);
 results in 100,0

 Interesting enough
 printf("%ld,%ld,%ld\n",100L,200L);
 results in 100,0,200

 if the values of 100 and 200 were just plain int(s) things work just fine
Aug 26 2003