This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

dynamic memory creation

can any one give me the solution.
 i want to send data through termial until some terminaion char is find.
 it should supprot for any lenth of data.
i dont know the lenth of string while writing code.

.

  • It is physically impossible to accommodate by way of storage "any length of data", so define storage of 'n' bytes (the value of 'n' being relevant and practical for your application) and allow your storage to hold up to the last 'n' received characters. When 'some termination char is find', you're done.