Switch in C/C++ like with Pawn
Well this dont is a Amxx Scripting but someone can help me :P
Well How is the sintax in C/C++ to do something like PHP Code:
Thanks. |
Re: Switch in C/C++ like with Pawn
PHP Code:
|
Re: Switch in C/C++ like with Pawn
Quote:
|
Re: Switch in C/C++ like with Pawn
Quote:
|
Re: Switch in C/C++ like with Pawn
|
Re: Switch in C/C++ like with Pawn
Aren't you trying to do this in C++? How is the Pawn manual relevant?
|
Re: Switch in C/C++ like with Pawn
If I set case 1..9: Dont compile, I test with 4 compilers :P
|
Re: Switch in C/C++ like with Pawn
I did some searching and found C++ doesn't support value ranges in switch statements. I guess you are stuck with if's.
|
Re: Switch in C/C++ like with Pawn
show full code i'd say, i didn't test cases much but i guess Case 1 To 10: should be ok for int , i used it only on strings, therefore sometimes switch is more problematic than if + else if statements and requires some tweaking like setting up breaks and default case
ps-*wish there were a c++ forum like allied mods with all open sources and scripting help like for pawn xD |
Re: Switch in C/C++ like with Pawn
I just added this line in a switch:
Pawn: Code:
C++ Code:
|
| All times are GMT -4. The time now is 13:54. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.