Vector test program
Type the default size of array and the size of incrementation.
Size:
Incrementation:
myMalloc: allocating 32 bytes, memory allocated 32 bytes
myMalloc: allocating 80 bytes, memory allocated 112 bytes
myRealloc: allocating 800 bytes, memory allocated 912 bytes
Press:
1 to show the length of vector
2 to add a new item
3 to remove an item
4 to print all items
5 to find out whether an item is present
6 to find an item's position
7 to clear the vector
8 to fill a portion of the vector with desired value
9 to create a copy of a vector
0 to print one item
anything else to finish.
Choose the value to be inserted:
Choose the starting position:
Choose the end position:
Press:
1 to show the length of vector
2 to add a new item
3 to remove an item
4 to print all items
5 to find out whether an item is present
6 to find an item's position
7 to clear the vector
8 to fill a portion of the vector with desired value
9 to create a copy of a vector
0 to print one item
anything else to finish.
vector[0]: 0
vector[1]: 5
vector[2]: 10
vector[3]: 1
vector[4]: 1
vector[5]: 1
vector[6]: 30
vector[7]: 35
vector[8]: 40
vector[9]: 45
vector[10]: 50
vector[11]: 55
vector[12]: 60
vector[13]: 65
vector[14]: 70
vector[15]: 75
vector[16]: 80
vector[17]: 85
vector[18]: 90
vector[19]: 95
Press:
1 to show the length of vector
2 to add a new item
3 to remove an item
4 to print all items
5 to find out whether an item is present
6 to find an item's position
7 to clear the vector
8 to fill a portion of the vector with desired value
9 to create a copy of a vector
0 to print one item
anything else to finish.
Choose the value to be inserted:
Choose the starting position:
Choose the end position:
Press:
1 to show the length of vector
2 to add a new item
3 to remove an item
4 to print all items
5 to find out whether an item is present
6 to find an item's position
7 to clear the vector
8 to fill a portion of the vector with desired value
9 to create a copy of a vector
0 to print one item
anything else to finish.
vector[0]: 3
vector[1]: 3
vector[2]: 3
vector[3]: 3
vector[4]: 3
vector[5]: 3
vector[6]: 3
vector[7]: 3
vector[8]: 3
vector[9]: 3
vector[10]: 3
vector[11]: 3
vector[12]: 3
vector[13]: 3
vector[14]: 3
vector[15]: 3
vector[16]: 3
vector[17]: 3
vector[18]: 3
vector[19]: 3
Press:
1 to show the length of vector
2 to add a new item
3 to remove an item
4 to print all items
5 to find out whether an item is present
6 to find an item's position
7 to clear the vector
8 to fill a portion of the vector with desired value
9 to create a copy of a vector
0 to print one item
anything else to finish.
Choose the value to be inserted:
Choose the starting position:
Choose the end position:
Press:
1 to show the length of vector
2 to add a new item
3 to remove an item
4 to print all items
5 to find out whether an item is present
6 to find an item's position
7 to clear the vector
8 to fill a portion of the vector with desired value
9 to create a copy of a vector
0 to print one item
anything else to finish.
vector[0]: 3
vector[1]: 3
vector[2]: 3
vector[3]: 7
vector[4]: 7
vector[5]: 7
vector[6]: 7
vector[7]: 7
vector[8]: 7
vector[9]: 7
vector[10]: 7
vector[11]: 7
vector[12]: 7
vector[13]: 7
vector[14]: 7
vector[15]: 7
vector[16]: 7
vector[17]: 7
vector[18]: 7
vector[19]: 7
Press:
1 to show the length of vector
2 to add a new item
3 to remove an item
4 to print all items
5 to find out whether an item is present
6 to find an item's position
7 to clear the vector
8 to fill a portion of the vector with desired value
9 to create a copy of a vector
0 to print one item
anything else to finish.
Choose the value to be inserted:
Choose the starting position:
Choose the end position:
Press:
1 to show the length of vector
2 to add a new item
3 to remove an item
4 to print all items
5 to find out whether an item is present
6 to find an item's position
7 to clear the vector
8 to fill a portion of the vector with desired value
9 to create a copy of a vector
0 to print one item
anything else to finish.
vector[0]: 3
vector[1]: 3
vector[2]: 3
vector[3]: 7
vector[4]: 7
vector[5]: 7
vector[6]: 7
vector[7]: 7
vector[8]: 7
vector[9]: 7
vector[10]: 7
vector[11]: 7
vector[12]: 7
vector[13]: 7
vector[14]: 7
vector[15]: 7
vector[16]: 7
vector[17]: 7
vector[18]: 7
vector[19]: 3
Press:
1 to show the length of vector
2 to add a new item
3 to remove an item
4 to print all items
5 to find out whether an item is present
6 to find an item's position
7 to clear the vector
8 to fill a portion of the vector with desired value
9 to create a copy of a vector
0 to print one item
anything else to finish.
Freeing all allocated memory.
myFree: releasing 880 bytes, memory allocated 32 bytes
myFree: releasing 32 bytes, memory allocated 0 bytes
All allocated memory was freed.
