Can anyone tell me what are these two ** in front of Adj_matrix?
pikkas
0
Light Poster
Recommended Answers
Jump to PostEach one designate a level of indirection (a pointer). So you can say that adj_matrix is a pointer to a pointer to int. My spidey sense says that adj_matrix is intended to be a dynamically allocated adjacency matrix, so you can do a google search for dynamic arrays in C++ …
Jump to Post>How can i give the values programatically and not by user selection?
That's even easier. Just replace scanf with an assignment to nv of whatever expression you want:nv = 5; /* allocate memory for the adjacency memory */ adj_matrix = (int**)malloc(sizeof(int*) * nv);
All 5 Replies
Narue
5,707
Bad Cop
Team Colleague
pikkas
0
Light Poster
Narue
5,707
Bad Cop
Team Colleague
pikkas
0
Light Poster
pikkas
0
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.