c++ - is not a member of 'std::vector<_Ty> -


there problem function , can not compail

tpacketgcshopstart* p = (tpacketgcshopstart*)vecbuffer.data(); 

error 1 error c2039: 'data' : not member of 'std::vector<_ty>' e:\source\clinet\userinterface\pythonnetworkstreamphasegame.cpp 1691 userinterface

since use version of visual studio , c++ compiler doesn't support c++11 standard (where the data function added) have 2 solutions:

  1. update later version of visual studio.
  2. remember memory handled std::vector contiguous array, , can pointer first element using same syntax: tpacketgcshopstart* p = &vecbuffer[0]

i rather recommend first solution, updating ide, since vs2008 neither supported nor support many of modern c++ functionality makes life easier c++ programmer.


Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -