Advertisement
AndreiS

Untitled

Apr 18th, 2015
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. char* create_message(node router){
  2.  
  3. ostringstream aux;
  4. vector<pair<int, int> > lista = auxListIdCost(router);
  5. //In aux salvez datele de care am nevoie din structura Routerului
  6. aux << router.id_node << " " << router.versiune;
  7. for(int i = 0; i <router.nr_vecini; i++){
  8. aux <<" " << lista[i].first << " " << lista[i].second;
  9. }
  10.  
  11. const string temp = aux.str();
  12.  
  13. char * fin = new char[temp.length() + 1];
  14. strcpy(fin, temp.c_str());
  15. //memset(fin,'\0', strlen(fin));
  16.  
  17. return fin;
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement