user69083: Today my answer was converted into a comment I do not know the reason why our moderator has changed my answer to the comment. The link to my answer is here. I still do not understand why it was deleted and merged with comments any light to it would be grateful so that if it's a mistake then I don't repeat it.
Thanks and Regards,
Maaz

user37622: That question was about compilation error which was solved by answer recommending to use .c_str().
The update turned the question into a troubleshooting case, which is not possible on a Q&A site. Sometimes we help troubleshot but not in answers but in comments. Your 'answer' is such a comment. If it takes many comments, then the session is moved to chat, which is more suitable because it can show source code.
If OP answers your comment, I will move the comments session to chat and you can do the troubleshooting there. But the question was asked 1 year, 4 months ago so I doubt OP still tries to solve this.
Note: strdup allocates string on heap

user4143: Simply because an answer asking the OP to try something is not an answer - it is one of a stream of comments.
If you want clarification or for the OP to try something out and get back to you then you ask that in comments. Once the cause and solution has been "nailed" in the comments you can flesh that out into a proper answer.

69083: <p>Today my answer was converted into a comment I do not know the reason why our moderator has changed my answer to the comment. The link to my answer is <a href="https://arduino.stackexchange.com/questions/74524/convert-json-into-string-for-mqtt">here</a>. I still do not understand why it was deleted and merged with comments any light to it would be grateful so that if it's a mistake then I don't repeat it.</p>
<p>Thanks and Regards,</p>
<p>Maaz</p>
 37622: <p>That question was about compilation error which was solved by answer recommending to use .c_str().</p>
<p>The update turned the question into a troubleshooting case, which is not possible on a Q&amp;A site. Sometimes we help troubleshot but not in answers but in comments. Your 'answer' is such a comment. If it takes many comments, then the session is moved to chat, which is more suitable because it can show source code.</p>
<p>If OP answers your comment, I will move the comments session to chat and you can do the troubleshooting there. But the question was asked 1 year, 4 months ago so I doubt OP still tries to solve this.</p>
<p>Note: <code>strdup</code> allocates string on heap</p>
 4143: <p>Simply because an answer asking the OP to try something is not an answer - it is one of a stream of comments.</p>
<p>If you want clarification or for the OP to try something out and get back to you then you ask that in comments. Once the cause and solution has been &quot;nailed&quot; in the comments you can flesh that out into a proper answer.</p>
