I need help improving the following code. This program converts input stream from ASCII to EBCDIC. It seems like this program is creating some memory errors while executing. Please see the code below-
Thanks for your reply. Sorry about missing code tags in post.
The program works successfully. However when I use it in my application, it aborts after some time. The product support says it is related to program memory allocation and release.
I need help improving the pointer usage. Therefore I need help from the experts.
Did you run the program with your debugger? The debugger should be able to tell you exactly where it detects the problem, and you should be able to view the variables at the time of the crash and then start back tracing the problem to find the problem.
The program you posted looks reasonable. As jlb suggested, you should be testing for errors on all calls. iconv_open(), iconv() and iconv_close() can all return errors.
There's no way we can spot errors in your application without seeing your actual code.
I have tried to implement your suggestion but still there are some errors. I will keep the existing program till I could find another way to implement the logic.