Why is it this doesn't work?
Thanks in advanced!Code:int func() { return 1; } //... switch (input) { case func(): //... break; }
This is a discussion on Functions in a switch case... within the C++ Programming forums, part of the General Programming Boards category; Why is it this doesn't work? Code: int func() { return 1; } //... switch (input) { case func(): //... ...
Why is it this doesn't work?
Thanks in advanced!Code:int func() { return 1; } //... switch (input) { case func(): //... break; }
Because this is wrong !
case takes only some constants (int,char)![]()