I want to create a 3D PCD file and then display it. I'm not able to figure out how to create a PCD file for a real life object.
I don't know what you mean by "real life object" but the PCD file format is quite well documented:
Information about the file format
You can visualize it using the Visualizer class (tutorial).
So e.g. make a scan of your "real world object", store point data in a PCD file and visualize it.
PS: Hm, what was your question?