I am developing a plugin for question & answer.For that i need to create custom post types question & answer.How to link that custom post types so that if i display a post from Question the related answers should be displayed.How to create two custom posts simultaneously when the plugin is activated?
WordPress have on default no relationship possibilities for the same objects, like custom post type. But you can create a custom table or use the meta data on each post to create a relationship.
Ready to use
Also it give usable ready solutions:
For a custom solution about meta fields:
You find in this answer helpful hints and the source for a relationshep between the meta data.