Upgrade to Pro — share decks privately, control downloads, hide ads and more …

C++ MIX #11 これどう読むの...?

C++ MIX #11 これどう読むの...?

C++ MIX #11 で発表したスライドです!

https://cppmix.connpass.com/event/319167/

Nobuyuki Nishiyama

June 15, 2024
Tweet

More Decks by Nobuyuki Nishiyama

Other Decks in Programming

Transcript

  1. ໰̏ #include <malloc.h> int main(int argc, char *argv[]) { if

    (argc > 0 && !p) { int a = argc < 10 ? -1 * 2 : 1 & 2; } void *p = malloc(100); }
  2. ໰̏ #include <malloc.h> int main(int argc, char *argv[]) { if

    (argc > 0 && !p) { int a = argc < 10 ? -1 * 2 : 1 & 2; } void *p = malloc(100); }    
  3. ໰̏ #include <malloc.h> int main(int argc, char *argv[]) { if

    (argc > 0 && !p) { int a = argc < 10 ? -1 * 2 : 1 & 2; } void *p = malloc(100); }
  4. ໰̏ #include <malloc.h> int main(int argc, char *argv[]) { if

    (argc > 0 && !p) { int a = argc < 10 ? -1 * 2 : 1 & 2; } void *p = malloc(100); }
  5. ໰̏ #include <malloc.h> int main(int argc, char *argv[]) { if

    (argc > 0 && !p) { int a = argc < 10 ? -1 * 2 : 1 & 2; } void *p = malloc(100); }
  6. ໰̏ #include <malloc.h> int main(int argc, char *argv[]) { if

    (argc > 0 && !p) { int a = argc < 10 ? -1 * 2 : 1 & 2; } void *p = malloc(100); }
  7. ໰̏ #include <malloc.h> int main(int argc, char *argv[]) { if

    (argc > 0 && !p) { int a = argc < 10 ? -1 * 2 : 1 & 2; } void *p = malloc(100); }
  8. ໰̐ struct Hoge { int x, y; }; int main()

    { Hoge v; v.x = 0; v.y = 0; }
  9. ໰̐ struct Hoge { int x, y; }; int main()

    { Hoge v; v.x = 0; v.y = 0; }
  10. ໰̐ struct Hoge { int x, y; }; int main()

    { Hoge v; v.x = 0; v.y = 0; }
  11. ໰̑ #include <iostream> constexpr int square(int x) { return x

    * x; } int main() { int i = 0 | 2; int& h = (i / 2) << 2; if (i > 0 || h > 0) { std::cout << "Hoge\n"; } }
  12. ໰̑ #include <iostream> constexpr int square(int x) { return x

    * x; } int main() { int i = 0 | 2; int& h = (i / 2) << 2; if (i > 0 || h > 0) { std::cout << "Hoge\n"; } }
  13. ໰̑ #include <iostream> constexpr int square(int x) { return x

    * x; } int main() { int i = 0 | 2; int& h = (i / 2) << 2; if (i > 0 || h > 0) { std::cout << "Hoge\n"; } }
  14. ໰̑ #include <iostream> constexpr int square(int x) { return x

    * x; } int main() { int i = 0 | 2; int& h = (i / 2) << 2; if (i > 0 || h > 0) { std::cout << "Hoge\n"; } }
  15. ໰̑ #include <iostream> constexpr int square(int x) { return x

    * x; } int main() { int i = 0 | 2; int& h = (i / 2) << 2; if (i > 0 || h > 0) { std::cout << "Hoge\n"; } }
  16. ໰̑ #include <iostream> constexpr int square(int x) { return x

    * x; } int main() { int i = 0 | 2; int& h = (i / 2) << 2; if (i > 0 || h > 0) { std::cout << "Hoge\n"; } }
  17. ໰̒ #include <string> #include <iostream> int main() { auto s

    = std::string{"Hoge"}; auto c = s[1]; printf("%s", s.c_str()); std::cout << s.substr(1, 2); }
  18. ໰̒ #include <string> #include <iostream> int main() { auto s

    = std::string{"Hoge"}; auto c = s[1]; printf("%s", s.c_str()); std::cout << s.substr(1, 2); }
  19. ໰̒ #include <string> #include <iostream> int main() { auto s

    = std::string{"Hoge"}; auto c = s[1]; printf("%s", s.c_str()); std::cout << s.substr(1, 2); }
  20. ໰̒ #include <string> #include <iostream> int main() { auto s

    = std::string{"Hoge"}; auto c = s[1]; printf("%s", s.c_str()); std::cout << s.substr(1, 2); }
  21. ໰̒ #include <string> #include <iostream> int main() { auto s

    = std::string{"Hoge"}; auto c = s[1]; printf("%s", s.c_str()); std::cout << s.substr(1, 2); }