Why declare OUTPUT pins?

Hi everyone, I'm fairly new to programming and using arduino to learn. I noticed that I had made a mistake in my program which was that I never declared pins I was using to control a double H bridge as OUTPUT's in my void setup but things still worked out as planned. I did declare them as int's at the start of my code and think this has something to do with why it still worked.

I have since fixed the "error" that was not causing me any trouble as every tutorial I have read/seen says this is the way to do it but was wondering if anyone could tell me why it still worked and why we declare the pins if they don't need to be?

I'm using an ATMEGA 2560.

Thanks for your time.

The pins default to INPUT on startup. Without setting them outputs with 'pinMode()', making them high only turns on the internal pullup resistors. They can't source more than a tiny bit of current.

Edit: It has nothing to do with declaring the pin numbers as 'int'. 'const byte' is better, by the way, and conserves RAM.

Writing to an input bit controls the pullup, so under no-load conditions it could seem to work.

Thank you, I now have a better understanding of what is going on.