home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.comp.os.windows-xp      Actually wasn't too bad for a M$-OS      17,273 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 17,119 of 17,273   
   Paul to R.Wieser   
   Re: wsprintf I64 - how to get it to incl   
   07 Jan 26 17:04:27   
   
   XPost: comp.os.ms-windows.programmer.win32, alt.windows7.general   
   From: nospam@needed.invalid   
      
   On Wed, 1/7/2026 3:14 PM, R.Wieser wrote:   
   > JJ,   
   >   
   > [quote=me]   
   >> Scratch that question.   
   >   
   > Scratch that.  I'd forgotten that I had changed my test value, and caused it   
   > to fit into 4 bytes.  Changing it back to 5E+10 the displayed result showed   
   > again a truncated 32-bit result   
   >   
   > Strange that "%lld" was not rejected as unrecognised though ...   
   >   
   > So, the question still stands :   
   >   
   > Any idea how to have sprintf (crtdll) print a 64-bit decimal value ?   
   >   
   > Regards,   
   > Rudy Wieser   
   >   
   >   
      
   I couldn't get my INT64_T to work, and I suspect I need to install   
   more packages in my mingw64 thingy. Adding the header files made no difference.   
      
   /* #include  */   
   /* #include  */   
   #include    
      
   /* gcc      -std=c99 -o wide.exe wide.c */   
   /* gcc -m64 -std=c99 -o wide.exe wide.c */   
      
   int main( void )   
   {   
      wchar_t buf[100];   
      /* int64_t i; */   
      long long int i;   
      
      i = 5000000000000 ;   
      
      int len = swprintf( buf, 100, L"%s %+lld %s", L"Pack my box with ", i, L"   
   liquor jugs" );   
      printf( "Generated %d characters\n\n", len );   
      
      wprintf(L"%ls\n\n", buf);   
   }   
      
    UCRT64 ~   
   $ ./wide   
   Generated 45 characters   
      
   Pack my box with  +5000000000000  liquor jugs   
      
      
   UCRT64 ~   
      
      Paul   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca