mercredi 24 mai 2017

generate multidimensinal array from cout

I have this main function and i want to get an multidimensional array out of this to generate a graph

int main(){
   zoro z;
   std:ifstream k("ggg.grf");
   z.getfromstream(k);
   for(int i =0 ; i < z.nnodes; i++){
     edge_iteratore s = z.begin(i);
     while(s != z.end(i)){
       std:cout << "(" << (*s).height << "," << (*s).weight << ")" << std::endl;
       ++s;
     }
   }

   return 0;
}

I' trying to get std::out to a function to generate a multidimensional array so i have implemented this function to get an array,

int createarr(height,width){

     int** ary = new int*[height];
for(int i = 0; i < height; ++i)
    ary[i] = new int[weight];

}

but nothing works

Aucun commentaire:

Enregistrer un commentaire