Question: Create a function called init 1 . This function will declare an array of size n and will assign random values ( if you want
Create a function called init This function will declare an array of size and will assign random values if you want to make things easier, you can create a loop from to and assign the value of to each element in the array This function must return the array created in the function. Plus, the only argument of the function is the length of the array.
Create a void function called init This function does exactly the same than init but I will not return anything. For this function, consider which parameters you need.
Assign an array to and using init and init respectively.
Finally, print the values not the addresses stored in p and p
Task : Pointers and functions Must finish in lab
In this task, we will create a structure called pseudodynamic and it will have the following members:
: a pointer that will store at the beginning element.
size: the maximum amount of numbers the array can store.
length: the current amount of numbers the user has stored in
Subtask:
Create a structure pseudodynamic and declare it in main.
Create a function called add to ask the user to add a new element in the array A This function must tell the user when there is no more available space in the array, and when this happens, you have to double the space double size and add the new inserted value.
Create a function called delete to remove the last element store in the array
Create a function called print to print all the values stored in the array, If the array is empty, it should print the message "Empty array".
Create a function to quit the program.
Use a loop to ask the user which function he wants to perform. If the user input a wrong a option, it must ask again. You should only exit the loop if the user wants to
All the functions must be a void function.
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
