This code allows you to visualise a pointer to a point cloud

boost::shared_ptr<pcl::visualization::PCLVisualizer> viewer 
       (new pcl::visualization::PCLVisualizer ("3D Viewer"));

viewer->addPointCloud<pcl::PointXYZRGBA> (pc_xyzrgba, "sample cloud");
viewer->addCoordinateSystem (1.0);
viewer->initCameraParameters ();

while (!viewer->wasStopped ())
{
    viewer->spinOnce (100);
    boost::this_thread::sleep (boost::posix_time::microseconds (100000));
}