当前位置:网站首页>C medium? This form of
C medium? This form of
2022-04-23 18:03:00 【OceanKeeper1215】
1. Nullable type modifier (?)
Citation type can use empty citation to indicate a non-existent value , The value type usually cannot be empty .
for example :stringstr=null; That's right. ,inti=null; The compiler will report an error .
To make the value type also nullable , You can use nullable types , Use the nullable type modifier "?" To show , The way of expression is "T?"
for example :int? Indicates nullable shaping ,DateTime? Indicates the time that can be empty .
T? It's actually System.Nullable( Generic structure ) The abbreviation of ,
That means when you use T? The compiler will compile T? Translate it into System.Nullable The way .
for example :int?, After compilation System.Nullable The way .
2. Three yuan ( Operator ) expression (?:)
for example :x?y:z Show that if the expression x by true, Then come back y;
If x by false, Then come back z, Is to omit if{}else{} In a simple way .
3. Null merge operator (??)
Default values used to define nullable types and citation types .
If the left operand of this operator is not null, Then this operator will return the left operand , Otherwise, the right operand .
for example :a??b When a by null When you come back b,a Not for null When you come back a Oneself .
The null merge operator is the right join operator , That is to say, it is combined from right to left during operation .
Such as ,“a??b??c” By the way of “a??(b??c)” Calculation .
4.NULL Look at the operator (?.)

版权声明
本文为[OceanKeeper1215]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230545104864.html
边栏推荐
- Thirteen documents in software engineering
- How to read literature
- C language loop structure program
- In JS, t, = > Analysis of
- 由tcl脚本生成板子对应的vivado工程
- 20222 return to the workplace
- Build openstack platform
- Flash operates on multiple databases
- The ultimate experience, the audio and video technology behind the tiktok
- Gaode map search, drag and drop query address
猜你喜欢

Cross domain settings of Chrome browser -- including new and old versions

由tcl脚本生成板子对应的vivado工程

The JS timestamp of wechat applet is converted to / 1000 seconds. After six hours and one day, this Friday option calculates the time

Welcome to the markdown editor

positioner

C# 网络相关操作

MySQL_ 01_ Simple data retrieval

2022 Jiangxi Photovoltaic Exhibition, China distributed Photovoltaic Exhibition, Nanchang solar energy utilization Exhibition

YOLOv4剪枝【附代码】

2022 judgment questions and answers for operation of refrigeration and air conditioning equipment
随机推荐
Flash - Middleware
Tensorflow tensor introduction
Cloud native Virtualization: building edge computing instances based on kubevirt
Arcpy adds fields and loop assignments to vector data
Docker 安装 Redis
Build openstack platform
C language loop structure program
2022 Jiangxi Photovoltaic Exhibition, China distributed Photovoltaic Exhibition, Nanchang solar energy utilization Exhibition
Crawl lottery data
C language array processing batch data
Anchor location - how to set the distance between the anchor and the top of the page. The anchor is located and offset from the top
20222 return to the workplace
_ FindText error
.104History
2022 judgment questions and answers for operation of refrigeration and air conditioning equipment
Secure credit
Scikit learn sklearn 0.18 official document Chinese version
Queue solving Joseph problem
Realization of consumer gray scale
Re regular expression