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 80 bytes, memory allocated 192 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.
myFree: releasing 160 bytes, memory allocated 32 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 of an item:
myRealloc: allocating 80 bytes, memory allocated 112 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 of an item:
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 of an item:
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 of an item:
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]: 15
vector[1]: 8
vector[2]: 66
vector[3]: 0
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 length: 4
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 of an item to be found:
Choose the initial index for searching:
Position of an item: 0
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 of an item to be found:
Choose the initial index for searching:
Position of an item: not found
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.
myFree: releasing 80 bytes, memory allocated 32 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.
End of file, finishing.
Freeing all allocated memory.
myFree: releasing 32 bytes, memory allocated 0 bytes
All allocated memory was freed.
