<div dir="ltr">Hi,<div><br><div>I am a bit struggling with what should be fairly simple. I have a pchar where I am adding and removing characters. What I did so far is to allocate new memory every time and copying the source pchar over to a new one to append or delete a character. This required two helper variables in order to allow for the swap. This does not seem to be very efficient to me and I was wondering if I am missing anything?</div><div><br></div><div>What also confused me in the beginning that assigning a string to a pchar automatically assigns memory for that pchar. Is there a way to control this? e.g. to switch this off and generate a compiler error or runtime error when this happens? I'd like to prevent runtime errors or memory leaks instead.</div><div><br></div><div>Thank you very much!</div><div><br></div><div>Rgds, Darius</div></div></div>