No, pretty sure the Arduino Core specific to the Nano maps those numbers to the SDA, SCL names. You'll note that @J-M-L's code does not #include wire.h.
No. The I2C signals are on specific pins of the board's ATmega328 processor. They set by the chip's design. They happen to be connected to 18 & 19 on this particular Arduino board.
When you program the NANO using the picture provided by in one of the replies above, do you use the numbes in purple ( on the far left and right of the picture ) or grey ( closest to the NANO diagram) for defining pin numbers?
When I program the Nano, I use purple digital pin numbers (2, 3, 4 ..., 13) and green analog pin numbers (A0, A1, A2 ..., A7).
By the way, these numbers are written on the board near the pins.
Refer to Fig-1 given above: 1. On the NANO Board, we have legends/inscriptions: A4 and A5, which are repectively connected with physical pin-27 and pin-28 of the microcontroller (MCU).
2. A4 and A4 have numerical values, which are respectively 18 and 19. A4/18 and A5/19 are known to Compiler as Digital IO Pins (DPin) when Port-C is enabled by closing K2. (K1 and K3 remaiin open.)
3. There are three individual electronics modules within the MCU and these are: (1) Port-C (Digital IO Port) (2) I2C Interface (Inter-integrated Circuit)/TWI (Interface (Two Wire Interface) (3) Ananlog-to-Digital Controller
4. All the above three modules share common two pins (27 and 28) of the MCU.
5. By default (after power up), K1 and K3 are at open condiion; K2 is at close condition. As a result, pc4 and pc5 IO lines of Port-C are routed to DPin-A4 and DPin-A5. This is the reason for the NANO board to have the inscriptions: A4 (DPin-A4) and A5 (DPin-A5). These pins are also given unseen numerical values of 18 and 19 in order to allow a programmer to use for() loop to configure the directions of a group of IO lines.
6. If we want to activate the I2C Interface, then we close K1 by storing 1 (HIGH) at TWEN-bit of TWCR Register, which is equivalent to Wire.begin() instruction. As a result, the SDA (Serial Data) and SCL (Serial Clock) line of the I2C Logic are routed to DPin-A4/18 and DPin-A5/19. (K2 and K3 remain opened.)
7. If we want to activate the ADC Module, then we close K3 by storing 1 (HIGH) at ADEN-bit of ADCSR Register. As a result, the ADC4 (Ch-4) and ADC5 (Ch-5) of the ADC are routed respectively to DPin-A4 and DPin-A5. (K1 and K2 remain opened.)
I would appreciate to receive any corrections/modifications/additions needed.