Question: // PROBLEM 1: Allocate a new stock struct and initialize its fields. // Integer fields like 'count' and 'lo_index' should be initialied to // -1.

// PROBLEM 1: Allocate a new stock struct and initialize its fields.

// Integer fields like 'count' and 'lo_index' should be initialied to

// -1. Pointer fields like 'prices' should be initialized to

// NULL. The stock should be heap-allocated using malloc() and

// returned. Since this is an allocation function, no use of 'free()'

// should appear.

stock_t *stock_new(){

// WRITE ME

return NULL;

}

C language

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!