我得到了错误" intitializer fails to determine size of 'K'"
int K[]= new int[Vertices->total];
Run Code Online (Sandbox Code Playgroud)
我该如何解决?
cod*_*ict 18
更改
int K[]= new int[Vertices->total];
Run Code Online (Sandbox Code Playgroud)
至
int *K = new int[Vertices->total];
Run Code Online (Sandbox Code Playgroud)
第一个是Java创建数组的方式,您K可以在其中引用整数数组.但是C++我们需要制作K一个指向整数类型的指针.