I am recently start in new company, they works on AIX v5.3 UNIX.
Trying some C-coding I have found that I am not able to print the 'long long int' type variables.
I have tried '%ll %L %LL %q' - no one is printing the #LL
Surprizingly, I can not access C-printf manual here, nor to find it on internet (related to AIX)
Most interesting that the #LL is accepted and processed well, but no way to print it
Maybe I shoud specify for 'cc', some options?
Maybe some specific include should be done with redefined or advansed 'printf()'?
Here is an example of my tryes:
Code:
int main()
{
int p1, p2, n1,n2,d1,d2;
long long int lln=987654321000LL,
lld=876543210000LL, llr;
llr=lln-lld;
p1=llr/100000; p2=llr%p1;
n1=lln/100000; n2=lln%n1;
d1=lld/100000; d2=lld%d1;
printf("The result of calculating #LL: (%d%d) - (%d%d) = (%d%d)\n",
(int)(lln/10000LL), 1000, (int)(lld/100000LL), 10000, p1,p2 );
printf("another try to print: %d,%05d; %d,%05d; %d,%05d\n",p1,p2,n1,n2,d1,d2);
printf("Trying to print 'long long' type"
"\n - by L: %L"
"\n - by LL: %LL"
"\n - by q: %q"
"\n - by ll: %ll"
"\n - by dll: %dll"
"\n - by d: %d"
"\n - bi i: %i\n", llr+1LL, llr+2LL, llr+3LL,llr+4LL, llr+5LL,llr+6LL,llr+7LL);
printf("binary for -558038695: %s\n",b_prn(-558038695,sizeof(int)) );
return 0;
}
/* results:
The result of calculating #LL: (987654321000) - (876543210000) = (111111111000)
another try to print: 1111111,11000; 9876543,21000; 8765432,10000
Trying to print 'long long' type
- by L:
- by LL:
- by q: q
- by ll:
- by dll: 25ll
- by d: -558038695
- bi i: 25
binary for -558038695: 11011110101111010000000101011001
*/
So, it shows that the 'long long' variables processed well, but to present it to printf() I do not know a specifier.