Deleting undesired characters at the end of a char : <p>With this code below I dont know how to delete the undesired characters appearing at the end of the message array. It is compulsory for me to use char, can't use strings, because of the rest of my code.
recvbuf is also a char* recvbuf=new char</p>

<pre><code>                char* message=new char[140];
                for (int i=1; i&lt;141; i++){
                    message[i-1]=recvbuf[i];
                }
                printf("Message: %s\n", message);
                delete[]recvbuf;
</code></pre>
