How do I provide a "delete" link for comments? For example, if I am posting a comment, how can I delete it?
How delete links should be given?
On Drupal 6, users with the permission of administer comments and create comments are able to delete comments. The code that adds the delete link for comments is contained in comment_links().

  if (node_comment_mode($comment-&gt;nid) == COMMENT_NODE_READ_WRITE) {
    if (user_access('administer comments') &amp;&amp; user_access('post comments')) {
      $links['comment_delete'] = array(
        'title' =&gt; t('delete'), 
        'href' =&gt; "comment/delete/$comment-&gt;cid",
      );
      $links['comment_edit'] = array(
        'title' =&gt; t('edit'), 
        'href' =&gt; "comment/edit/$comment-&gt;cid",
      );
      $links['comment_reply'] = array(
        'title' =&gt; t('reply'), 
        'href' =&gt; "comment/reply/$comment-&gt;nid/$comment-&gt;cid",
      );
    }


Similar code is present in Drupal 7 and higher.

Third-party modules allows other users to delete comments.


Comment Delete allows the comment authors to delete the comment they created. The module is for Drupal 6.
User tweaks, a module I maintain, allows the comment's authors to delete their own comments; it also allows users to delete any comment, or any comment associated with nodes of specific content types. In both the cases, the user needs an additional permission, but not the permission to administer comments. The module is for Drupal 7.