Array.at() wont work in c++
Array.at() wont work in c++
Im working on an assignment in c, in which there is a class function that counts the number of nodes, and returns that number as an int. I then need that number to create an array of that size, as well as fill the arrays with the number of -1, but when I compile I keep getting an error for variable-sized object shortest_distance may not be initialized, and the same error with the predecessor array. Where might I be going wrong, and how can I fix this The array-making lines is right below. double shortest_distanceG.numNodes -1 ; int predecessorG.numNodes -1 ; G is the name of the variable for the class, and numNodes is the function name that returns the amount of nodes as an int. If there is any additional information I should provide let me know, and thanks for any help.
Комментарии
Отправить комментарий