I'm not sure how exactly to put this question (which I guess has made it hard to search for a suitable answer). I've been programming PICs for a while and have always "output" any data through a UART to PC (where I collect). I'm working on a project where the data need to be stored for about 12 hours in internal memory, then sent via UART (XBee). I want to concatenate the new data with the historical data every 5 seconds. So, I was trying to remember the old days using C for strings and arrays (not too much is left in the noggin). Essentially, I think I want to create a memory block with a pointer (string *s). However, I don't know exactly how much data I'm going to collect. I have a decent idea, but I'd like to allocate enough to be safe. My compiler (mikroC) supports malloc, but I still don't know how best to allocate (I'm using a PIC32MX460x512L - so I could just allocate most of the data memory I guess). Is there a straightforward way to allocate a string variable of ~500kb?
Secondly, from my memory, if you wanted "increment" a file, you would "find" the EOF and start writing there, but that was opening actual files on the computer. If I have a string and I want to "add" the new data collected in the current 5 second interval, is it just best to do a strcat or is there a more elegant (or better) way?
Sorry for such a noob question, but I hadn't really even thought about how I'd do this, and I really can't find a clear example (but again, it could be the way I'm searching). Any advise would be greatly appreciated.
Secondly, from my memory, if you wanted "increment" a file, you would "find" the EOF and start writing there, but that was opening actual files on the computer. If I have a string and I want to "add" the new data collected in the current 5 second interval, is it just best to do a strcat or is there a more elegant (or better) way?
Sorry for such a noob question, but I hadn't really even thought about how I'd do this, and I really can't find a clear example (but again, it could be the way I'm searching). Any advise would be greatly appreciated.