Create a C++ program and include the following structuredefinition:
struct List {
int list[MAX];
int len;
};
Create function stubs to add, search and remove integers to thelist, and print the list.
void add(List& l, int key);
int search(List l, int key);
void remove(List& l, int key);
void print(List l);
In main():
-
Create a List variable myList. Initialize the array elements andlen to 0.
-
Complete and use add() to add 10 integers to array in myList .Remember to increment len.
-
Complete and use search() to search for an integer in thearray.
-
Complete and use remove() to remove one of the integers from thearray.
Complete and use print() to print out the contents of thearray.
Answer
#include<iostream>
#
OR
OR