Why can't variables be declared in a switch statement?

Subscribers:
4,140
Published on ● Video Link: https://www.youtube.com/watch?v=x69MgV99JFc



Duration: 6:21
3 views
0


Why can't variables be declared in a switch statement?
I hope you found a solution that worked for you :)
The Content (except music & images) is licensed under (https://meta.stackexchange.com/help/licensing)CC BY-SA
Thanks to all those great people for their contributions!

(stackoverflow.com/users/9236/rob)Rob
(stackoverflow.com/users/3022/tj-seabrooks)TJ Seabrooks
(stackoverflow.com/users/187690/ant-stands-with-russia)AnT stands with Russia
(stackoverflow.com/users/11698/richard-corden)Richard Corden
(stackoverflow.com/users/986/mark-ingram)Mark Ingram
(stackoverflow.com/users/775964/jeegar-patel)Jeegar Patel
A special thanks goes out to the (https://stackoverflow.com/questions/92396/why-cant-variables-be-declared-in-a-switch-statement)Stackexchange community

I wish you all a wonderful day! Stay safe :)

c++ c switch-statement







Tags:
c++
switch-statement