fork(2) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. namespace UART {
  5. struct A{//名前は任せる。
  6. int baud;
  7. int stop;
  8. int bit;
  9. int parity;
  10. };
  11. constexpr A A0 = A{ 115200, 1, 8, 0 };
  12. constexpr A A1 = A{ 9600, 2, 8, 1 };
  13. //structが嫌ならint A0_baud = 115200
  14. }
  15.  
  16. int main() {
  17. cout << UART::A0.baud << endl;
  18. return 0;
  19. }
Success #stdin #stdout 0s 4528KB
stdin
Standard input is empty
stdout
115200