You have several options for follow-ups:
If one of the answers gives you good advice with clear directions for improving your code, just accept the best answer and upvote any other answers you feel were helpful. The checkmark that you confer is the best way to show appreciation on this site, as it gives 15 reputation points and raises that answer to the top. Posting your revised code would be redundant.
If you incorporate advice from one or more answers, but are still unsure that the code is as good as it should be, then post a new question with your revised code. For the benefit of other users, add mutual links: mention the previous question in the new question, and add a comment on the old question linking to the follow-up question.
If you want to show everyone how you improved your code, but don't want to ask another question, then post an answer to your own question. Selfie answers are acceptable on Stack Exchange sites, and even encouraged: theres a self-learner badge you can earn for that. Selfie answers can even be upvoted, downvoted, or commented on in their own right. However, your answer must meet the standards of a Code Review answer, just like any other answer:
- Code-only answers are insufficient and are subject to deletion.
- Describe what you changed, and why.
- Give credit to any other users who may have helped you.
If you are unwilling to write the accompanying explanation, then it would be best to refrain from posting any follow-up at all.
You must not edit the code in the question, as that would violate the question-and-answer nature of this site. (An exception to that would be if a user wrote a comment saying that your code is completely broken, and needs to be fixed before it can be reviewed.)
You also should not append your revised code to the question. Posting improved code is an answering activity, not a questioning activity. An example of such a problematic edit is Revision 2 of Optimize vector rotation. While the addendum to the question does not necessarily invalidate existing answers, it muddles the question. What are late-coming reviewers supposed to do? Reviewing the original code would be silly, but reviewing the revised code could lead to version skew among the answers.
On the other hand, that improvement would have made a good answer, since it was prefaced with a good justification for the code change. A reviewer who spots a problem with the revised code could post a comment, and it would be clear that the comment pertains to that revision. You could even post multiple selfie answers without muddling the original question.
Here are a few more illustrations of how adding revised code to the question is poor practice:
StoredErrorWriter — Notice the big code dump in the question labelled "// Edit". What is anyone supposed to do with that? Nobody wants to take the time to diff the final with the original, and the follow-up isn't going to help anyone learn anything.
Simple method to detect int overflow — The follow-up largely repeats the advice in one of the answers. Yet, posting the follow-up kills the question, leaving no room for late-coming answers.
Linux C++ Timer Class: How can I improve the accuracy? — Revised code was added, but without explanation. One of the late-coming answers pertains to the revised code. Ideally, the revision should have been posted as a new question, since there was so much code that changed.
Pretty-print Pascal's triangle — The follow-up seems to be largely based on advice from one answer, but it isn't clear exactly how. Furthermore, @alexwlchan had to post an addendum to an answer in response to the follow-up. That's a mess of a thread for anyone to follow. Then, when I later posted an answer, I had to preface my remarks by noting that I was reviewing Revision 7. Yuck!
Hexadecimal to integer conversion function — Five addenda, 16 revisions. Enough said.