How to know the current bounds of HEAP.

PaulS:
Write what to what address? You can only write directly to a memory location using assembler. The indirect methods, like x = 14; are far easier to use.
So, what makes you think you can write a class that is better, for some definition of better, than String? You need more than ego for that.

Yes directly to memory locations. Yes, of course, I need more than just ego for that but just because I am new to this doesn't mean I can't, after all, everyone is at some point. If I had sounded like I was condescending the current class I apologize and I didn't mean it that way. I have written functions to write Strings to EEPROM and I think that method can be incorporated in the class that I'm writing.

BulldogLowell:
what do you think is the advantage of the String class (in this context)? the operators?

If I had to use a character array then I would need to specify the length of the array during declaring and I may end up needing more space. The String class doesn't have this problem as I can assign any sentence regardless of its size, I hope you get my point. That is the main feature I'm after since there are functions that do the same as operators like strcmp().

My idea for solving the heap fragmentation problem is to move the consecutive addresses away or "pull" them closer to accommodate the new size of the String. I have implemented this method in my function for writing Strings to EEPROM while overwriting a String that is already stored.

link:Arduino is freezing after running function twice - Programming Questions - Arduino Forum

Thanks for your time :slight_smile: