How to assign to a bool variable certain value (not true and not false)? I guess it can be so-called null state. But I'm not sure if it's correct guess. And I have no clue how to do that. Moreover, how to do that with possible further assignation (true/false)?
布尔值是一种值类型,如果要使用null进行初始化,则可以声明可为null的布尔变量,例如:
bool? x
That's right
Types that can be set to NULL are instances of the System.nullable structure.
T? variable = null;
troubleshooting
Cannot implicitly convert type 'bool?' to 'bool'. An explicit conversion exists (are you missing a cast?)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.