Thank you my friend for the lesson on vectors :)
I have already included the deletion of the objects in my code.
I hope to recompense you for your time in the future! :)
User Profile
Collapse
-
I made some new modifications considering your ideas, and the code now works just perfect...below I post the code just for the story :)
thank you very much for your time!
...Code:#include <iostream> #include <fstream> #include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <string.h> #include <math.h> #include <limits.h>
Leave a comment:
-
What I'm trying to do is the below schema
1-> <1,2> -> <1,4>
2-> <2,1> -> <2,3> -> <2,4>
3-> <3,2> -> <3,5> -> <3,4>
4-> <4,1> -> <4,5> -> <4,2> -> <4,3>
5-> <5,3> -> <5,4>
so that I can take advantage of the graph's properties, such as find shortest paths etc.
The first...Leave a comment:
-
Actually it didn't work perfect. I modified the code as you instructed me, but there is still a logical error that I can't figure out.The result of the last cout in main should be 4 according to logic. But still is NULL the same error that I stated at my first post!
Nevertheless, thank you very much for your answer!
...Code:#include <iostream> #include <fstream> #include <stdio.h> #include
Leave a comment:
-
-
Problem with graph implementation using adjacency lists
The following code is part of a bigger project in which I simulate a non-directed graph using adjacency lists. The code has no compilation errors. When I use in my main function (which is not provided below) the InserEdge function for the first time (to insert e.g the edge <1,3>) then there is no problem. But when I try to insert a second edge with the same initial node (e.g <1,6>) then the program fails. More particulartly, when I am...
No activity results to display
Show More
Leave a comment: