Skip to main content
Arduino

Return to Answer

Commonmark migration
Source Link

The problem is with sizeof(com) in your loops. sizeof() is for C arrays, not string objects. If you print it, it will report 6, which is not the length of the array. For string objects you should use com.length() instead. Then the output becomes

Saved

Testing~Network123......

P.S. The EEPROM can store 1024 bytes on ATmega328P-based boards (I believe that's what most Arduino Nanos use (clones included).

The problem is with sizeof(com) in your loops. sizeof() is for C arrays, not string objects. If you print it, it will report 6, which is not the length of the array. For string objects you should use com.length() instead. Then the output becomes

Saved

Testing~Network123......

P.S. The EEPROM can store 1024 bytes on ATmega328P-based boards (I believe that's what most Arduino Nanos use (clones included).

The problem is with sizeof(com) in your loops. sizeof() is for C arrays, not string objects. If you print it, it will report 6, which is not the length of the array. For string objects you should use com.length() instead. Then the output becomes

Saved

Testing~Network123......

P.S. The EEPROM can store 1024 bytes on ATmega328P-based boards (I believe that's what most Arduino Nanos use (clones included).

added PS section: eeprom size
Source Link
ex-punctis
  • 293
  • 2
  • 5

The problem is with sizeof(com) in your loops. sizeof() is for C arrays, not string objects. If you print it, it will report 6, which is not the length of the array. For string objects you should use com.length() instead. Then the output becomes

Saved

Testing~Network123......

P.S. The EEPROM can store 1024 bytes on ATmega328P-based boards (I believe that's what most Arduino Nanos use (clones included).

The problem is with sizeof(com) in your loops. sizeof() is for C arrays, not string objects. If you print it, it will report 6, which is not the length of the array. For string objects you should use com.length() instead. Then the output becomes

Saved

Testing~Network123......

The problem is with sizeof(com) in your loops. sizeof() is for C arrays, not string objects. If you print it, it will report 6, which is not the length of the array. For string objects you should use com.length() instead. Then the output becomes

Saved

Testing~Network123......

P.S. The EEPROM can store 1024 bytes on ATmega328P-based boards (I believe that's what most Arduino Nanos use (clones included).

Source Link
ex-punctis
  • 293
  • 2
  • 5

The problem is with sizeof(com) in your loops. sizeof() is for C arrays, not string objects. If you print it, it will report 6, which is not the length of the array. For string objects you should use com.length() instead. Then the output becomes

Saved

Testing~Network123......

AltStyle によって変換されたページ (->オリジナル) /