在switch-case中定义了变量,用g++编译的时候报错crosses initialization of “XXX” ,在网上一查,说是gcc要求变量的定义不能位于goto之后

将变量定义放在switc-case外就解决了。

参考链接:

http://blog.sina.com.cn/s/blog_4b9eab320100s8s1.html

相关文章:

  • 2021-04-20
  • 2021-09-11
  • 2022-12-23
  • 2021-07-13
  • 2021-11-21
  • 2021-08-14
  • 2021-11-03
  • 2022-02-10
猜你喜欢
  • 2022-01-16
  • 2023-03-21
  • 2021-10-26
  • 2021-09-16
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案