Thursday, September 24, 2009

My bug with printf - who'd help?

There is such code:

#include <stdlib.h>
#include <stdio.h>

int main() {
 int a;
 a = 5;
 int *b = &a;
 long long c = 2;
 printf("C = %lld, A = %d and I expected %d\n", c, *b);
}
And a result is as below:

C = 2, A = 0 and I expected 5

I have experimented a bit but did not found correct format.
Anyone?

No comments:

Post a Comment