47. Aliasing Nested Namespace

Back To All Submissions
Previous Submission
Next Submission
#include <iostream>
using namespace std;

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

int main() {
    namespace c = Communication::I2C;
    cout<<"I2C Speed: "<< c::speed;
    // your code here: create alias CI for Communication::I2C
    // your code here: print speed using CI
    return 0;
}

Solving Approach

 

 

 

Was this helpful?
Upvote
Downvote