You are attempting to dereference a pointer that has a random value.
On the fourth line you say: TeamS* teams;
There is no initialization. teams has a random value — it can point anywhere in memory. Hence, line 6: teams->ID = ID[i];
is an attempt to access random memory.
It would appear that this function desires to put values in the argument TeamV. You should do that:
1 2 3 4
TeamS team;
team.ID = ID[i];
...
TeamV.push_back( team );
BTW, this is the Windows forum. You should have posted this in Beginners.