limits.h question

B

blaat

Hey, I'm learning about the limits header, and I don't understand one
snippit of code. If I code:

#include <limits.h>
#include <stdio.h>
int main()
{
printf("Smallest signed long long: %lld\n", LLONG_MIN);
return 0;
}
I get the output:
Smallest signed long long: 0

Why is this? I even check in my limits.h file, where I see:
#define LLONG_MIN 0x8000000000000000 /*minimum signed __int64 value */

Why won't it print the limit?
 
C

codymanix

printf("Smallest signed long long: %lld\n", LLONG_MIN);

Iam not sure, but what if you try %i64 as format specifier?
 
B

blaat

codymanix said:
Iam not sure, but what if you try %i64 as format specifier?

I'm learning about standard C and %i64 makes assumptions about long long
being 64 bit so that probably is not standard C.
I guess the latest VC has implemented long long as an afterthought.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top