I tried it with an int too just to be sure:
same thing happenedCode:class aodv_rit { public: std::vector<int> intest; int recvPacket(unsigned char *packet, int size); } int aodv_rit::recvPacket(unsigned char * packet, int size) { ... intest.push_back(1); ... }
although I tried it like this and it worked:
It seems if I declare the vector in the same function where I use it it works fine. Any suggestions anybody. I am really at a loss here. Thanks a lotCode:int aodv_rit::recvPacket(unsigned char * packet, int size) { ... std::vector<int> test2; test2.push_back(1); std::vector<RREQ_STRUCT> rreq_test; ... ... ... rreq_test.push_back(rreq_object); ... }
Amish




Reply With Quote