ankur_ 24 Light Poster

Hello.

I have a question about Const Int and Points

I have this code

const int j=18;
    int *k= (int)&j;
    *k=110;
    printf("Data: %d -> %d; %d : %d-> %d\n", &j, j, k, &k, *k);

this well return for me
Data: 2280676 -> 18; 2280676 : 2280672-> 110
but if i remove "const" well i have
Data: 2280676 -> 110; 2280676 : 2280672-> 110 this work.

But how can same memory address have two int ( 18 and 110 )
Can somebody tell me how this are possible?

Try again it will give 110 for both

ankur_ 24 Light Poster

How to:
1. Buffer output ?
2. Get its size ?
3. Print the buffer ?

#include <stdio.h>

int main(void)
{
	printf("Tons of printf lines\n");

	// 1. Somehow buffer the output up until this point

	printf("The size of the buffer is: %i\n", SIZEOFBUFFER); // 2. Get and print the size of the buffer.

	printf("Here is the output:\n\n%s", BUFFER); // 3. Print the buffer.

	return 0;
}

What is SIZEOFBUFFER and BUFFER in your code and can you explain clearly what you want