Hello,

I am working on an assignment in which I have to dynamically allocate an array of two bytes and in which the memory should not be initialized at first.

This is for a univ class that I am taking without the pre req. I know basically nothing of C, have never written anything in C, but I have been reading up on notes everywhere for the last few days. I have a good Java background and I am building on that.

Regarding the assignment, I have gathered a few ideas but I have some questions.

I understand I have to use the malloc(2) function to do this. And here are my questions:
what happens when you call that function exactly? I know it reserves space in the memory BUT does it fill it up with anything? does it direct a pointer to it? How do I access that memory space afterward essentially?

One of the outputs of the program should be: The number of 'ones' in the memory allocated and the number of 'zeros' in the memory allocated.

So the question is:is the memory already filled with 1 and 0 after the malloc instruction? If not, how do I fill it up??

Thanks guys,

Francesco