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
Get step-by-step solutions from verified subject matter experts
