Dsa Lab 1
Dsa Lab 1
Lab 1
Objectives: Get the knowledge of implementing pointers to function/object using C++
programming language.
Problem:
Write the C++ code to implement the class arrayListType which performs the following tasks:
Task 1: Write the function definition of removeAt of the class arrayListType which removes
an element from the list by shifting the elements of the list. Test this function by taking a char
array and position/location of the element to be removed as input.
Note: To calculate the length of an array using pointer a separate function findlength should be
performed.
#include<iostream>
class arrayListType {
private:
int listlength;
public:
void removeAt(char* plist, int loc);
void remove(char *plist, char element);
void removeAll(char *plist, char element);
void removeBySwapAt(char *plist, int loc);
int findlength(char *ptr);
void print(char *plist);
};
int main()
{
int eno;