TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: Simeon Cran
from: david nugent
date: 1994-02-28 00:21:46
subject: printf an long integers

> >> I'm trying to show the size of a file with ftell() and printf().
 > >> Something like:
 > >> printf("The file is %u bytes long", ftell(filename));
 > >> works ok until the file gets larger than 64k.

 > dn> RTFM, "%lu".

 > I read it, tried various things, but I can't work it out. %lu
 > doesn't work. It leaves that field blank. If I use %u it
 > works fine up to 64k then overflows.

 > This is QuickC for Windows in Ansi mode. If you reckon that
 > %lu definitely works could you post a quick and dirty program
 > which shows the size of a file using %lu and I'll compile it
 > on QuickC and see what happens.

It works.  The code above _should_ work just fine as is.

I assume that the appropriate header (stdio.h) is included in which ftell()
is prototyped?

david

---

* Origin: Unique Computing Pty Ltd (3:632/348)
SEEN-BY: 50/99 54/54 620/243 623/630 632/103 301 348 386 998 633/371 634/384
SEEN-BY: 635/210 502 503 544 636/100 670/206 711/409 430 807 808 809 932 934
SEEN-BY: 712/623 713/888 714/906 800/1
@PATH: 632/348 635/503 50/99 54/54 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.