Code:main() { int i=3; printf("value of i=%d",i); printf("address of i=%u",&i); printf("value of i=%d",*(&i)); }
Code:main() { int i=3; printf("value of i=%d",i); printf("address of i=%u",&i); printf("value of i=%d",*(&i)); }
C enlightened
There are no error messages,I just cannot see the output screen.
C enlightened
stdout is buffered and will display when it reaches a newline or is flushed.
gg
Hello codeplug,can you explain what is stdout?Is it a pre processor directive like stdio?
C enlightened
Thanks,got the output,just had to use a pre-processor directive.
C enlightened
>> can you explain what is stdout?
"stdout" is the stream that printf() prints to.
gg
As long as we are making improvements to the code, we may as well fix everything:
Code:#include <stdio.h> #include <stdlib.h> int main(void) { int i = 3; printf("value of i = %d\n", i); printf("address of i = %p\n", (void*)&i); printf("value at %p = %d\n", (void*)&i, *(&i)); return EXIT_SUCCESS; }