ltib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ltib] a's in integer output


From: Tobias Simon
Subject: [Ltib] a's in integer output
Date: Tue, 23 Jan 2007 09:05:13 +0100 (MET)
User-agent: KMail/1.8

Hello List,

I found out that the a's replace the 0's. I was able to write two programs 
(one not working correctly, one working correctly):

not working (prints a's):

int main(void)
{
  unsigned int i, size = 100;
  for (i = 0; i < 100; i++)
     printf("%2llu %% complete\n", (unsigned long long)i * 100 / size);
  return(0);
}


working:

int main(void)
{
  unsigned int i, size = 100;
  for (i = 0; i < 100; i++)
     printf("%2lu %% complete\n", (unsigned long)i * 100 / size);
  return(0);
}

I use linux-2.6.10-cf-COBRA5475 but I don't think it's a Kernel Problem. It 
seems to be the compiler or glibc.

Regards,
Tobi
-- 
Tobias Simon
senTec Elektronik GmbH
address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]