Question: Exercise # 1 : Implement the getInputArray function [ 2 0 pts ] The first thing program hw 7 _ main _ program does is
Exercise #: Implement the getInputArray function pts The first thing program hwmainprogram does is call a getInputArray function. The C prototype of this function is as follows: char getInputArrayint numelements; You must implement this function in hwfunctions.asm which contains an empty placeholder for it Function getInputArray does: Reads a positive integer the element count n Sets numelements to n Allocates an array for n bytes Reads in n byte positive integers and stores them in order in the array Returns a pointer to the first element of the array To implement this function you need to allocate memory. To this end you should call the allocatememory function, which is provided in hwfunctions.asm. This function takes a number of bytes as argument and allocates a contiguous zone of this many bytes. Its return value is the address of the first bytes in that allocated zone. Here are example interactions with the program for various input: hwmainprogram The entered values are: findFirstIndex not implemented
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
