#include <iostream> using namespace std; void init(int pin) { cout << "PIN " << pin; } void init(int* portPtr) { cout << "PORT NULL"; } int main() { int mode; cin >> mode; if (mode == 1) { int pin; cin >> pin; init(pin); // calls int overload } else if (mode == 2) { init(nullptr); // calls pointer overload } return 0; }
Explanation & Logic Summary:
int
int*
0
NULL
nullptr
Firmware Relevance & Real-World Context:
Test Cases
Test Results
Input
1 7
Expected Output
PIN 7