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 speed = 400_000;
    }
}

int main() {
    namespace CI = Communication::I2C ;
    cout << "I2C Speed: " << CI::speed ;
    return 0;
}

namespace alias = x :: y ;

 

 

 

Was this helpful?
Upvote
Downvote