我试图做出类似的东西:
// int counter; - this is changing in ther other parts of program
bool abc1; bool abc2; bool abc3; bool abc4;
if("abc" + counter == true)
{
//some code
}
Run Code Online (Sandbox Code Playgroud)
无论如何,我需要将string和int转换为bool名称.我怎样才能做到这一点?
改为使用数组:
bool[] abc;
// ...
if (abc[counter] == true) {
{
// some code.
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
465 次 |
| 最近记录: |