3
votes
Accepted
Conditional assignment of array
Let's consider this:
case 0:
my_array[] = {DATA HERE};
exec_func(myarray);
This is not quite valid C++, but let's pretend you get the syntax right
to make it work. The problem is: doing this ...
3
votes
Why does Serial.print(1) cost 228 bytes more program memory compared to Serial.print((char)(48+1))?
The difference is simply this:
Print this character
and
Interpret this integer as a sequence of digits, work out the ASCII characters that represent each digit in turn, and print them.
As you can ...
2
votes
Accepted
How to make the compiler ensure that local variables memory allocation won't cause any RAM overflow during execution?
You are describing "memory profiling" and is not typically a feature of C or C++. It is more common in higher level languages, such as Java, but C is a considered a much lower level ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
memory-usage × 141memory × 39
arduino-uno × 31
c++ × 17
sram × 16
programming × 14
code-optimization × 10
arduino-nano × 9
array × 9
flash × 9
arduino-mega × 8
arduino-ide × 8
eeprom × 8
arduino-due × 7
progmem × 7
string × 6
variables × 6
pointer × 6
serial × 5
sd-card × 5
attiny × 5
compiler × 5
atmega328 × 4
debugging × 4
esp8266 × 3