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!