#include <iostream> using namespace std; // Overload 1: initialize GPIO pin void init(int pin) { cout << "PIN " << pin; } // Overload 2: initialize using port pointer void init(int* portPtr) { cout << "PORT NULL"; } int main() { int mode; cin >> mode; if (mode == 1) { int pin; cin >> pin; init(pin); // Call correct overload here } else if (mode == 2) { init(nullptr); // Call correct overload using nullptr here } return 0; }
Test Cases
Test Results
Input
1 7
Expected Output
PIN 7