View Single Post
  #2   Spotlight this post!  
Unread 28-06-2016, 21:25
axton900's Avatar
axton900 axton900 is online now
Programming Co-Captain
FRC #1403 (Cougar Robotics)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2015
Location: New Jersey USA
Posts: 45
axton900 has a spectacular aura aboutaxton900 has a spectacular aura aboutaxton900 has a spectacular aura about
Re: C++ NetworkTable code error

Hey!
The getTable method returns a shared pointer. So you have to declare your table as a shared pointer by writing:
std::shared_ptr<NetworkTable> table = NetworkTable::GetTable("datatable");

That should fix that issue!


That tutorial is from 2014 and WPILib has been updated and is now in C++11 which introduced Smart Pointers. I would suggest taking a look at the library :Here!
__________________
Team 1403: Cougar Robotics (2015 - present)

Reply With Quote