Aliasing Namespace

#include <iostream>
using namespace std;

namespace Communication {
    namespace I2C {
        int speed = 400000; // 400 kHz
    }
}

int main() {
    namespace CI = Communication::I2C;
    cout << "I2C Speed: " << CI::speed << "\n";
    return 0;
}
Upvote
Downvote
Loading...

Input

Expected Output

I2C Speed: 400000