This is for the Traveling Sales program assigned to me in my Computing Foundations Class. One of the rules in the class is that are NOT allowed to use the STL in any way other than what our professor tells us for each individual assignment. In this case we are allowed to use string.
My current problem is creating a dynamic amount of cities/routes. My plan was to create a 13 by 13 array and then remove any elements that aren't used. In Java this is no big deal, but in C++ I am finding it hard to solve.(without using vector)
Is there a way (without using vector/anything in the STL) to remove any unfilled slots from an array? In other words decrease the size of the array until it reaches the first slot that has been taken up?
Another solution to this would be to create an array that is of a dynamic size, but google and cplusplus.com are telling me that you can't do that without using vector.
Example:
int matrix [13][13] = {};
for (int i = 0; i < 12; i++){
matrix [i][i] = 4;
}
That would leave me with slots [12][13] and [13][13] ect.. empty how would I delete any slots that are empty?