以下のコードを一度見て、私の疑問を明確にしてください。疑問がある各行に疑問をコメントしました。さらに、それは巨大なものからのコードの一部です。そのため、変数宣言とすべてを無視してください。
コード全体が完璧に機能しており、コンパイル中にエラーは発生しません。
double Graph::Dijkstra( path_t& path )
{
int* paths = new int[_size];
double min = dijkstra(paths); // **is a function call or not? bcz i didn't found any function in the code**
if(min < 0) { delete[] paths; return -1;}
int i = _size - 1;
while(i>=0)
{
path.push(i); // **when will the program come out of this while loop, i'm wondering how does it breaks?**
i=paths[i];
}
path.push(0);
delete[] paths;
return min;
}
完全なコーディングはこちらから入手できます。