Big Picture
Do you have any kind of a design for this assignment?
Because it seems like a large problem, one which isn't going to be solved just by bashing in random code until it works (because it won't).
Think about what your adjacency list class needs to provide
- create
- destroy
- add nodes
- print nodes
- remove nodes
- and so on...
When you have a class, write a simple test for it, something like
int main ( ) {
myAdjList list; // should call constructor
list.add( 1,2 );
list.add( 3,4 );
list.print( ); // should see 1,2,3,4
list.remove( 1 );
list.print( ); // only 3,4 left
// destructor called round about now
}
When you have a class which works, then you can use it in anger to solve your assignment, knowing that the basic components are going to work.
Do you need other classes, or just the one and a main() to sequence everything together?
If you need other classes, how are they going to interact with one another.
Draw some diagrams on paper, index cards, post-it notes to remind you of what the overall design of the program is supposed to be.
----- ----- ----- -----
Little Picture
As this appears to be C++, then use C++ I/O.
Eg.
int a, b;
char burnAComma;
while ( cin >> a >> burnAComma >> b ) { …