Is there a way of preventing the reset when starting the serial monitor in the Arduino IDE?
For the Uno, connect a 10μF capacitor between the reset and ground pins.
For other Arduinos, a 120 Ohm resistor (or equivalent resistance made up of multiple resistors, since 120 Ohms is quite rare on its own) between the 5V and Reset pins should do the trick.