当前位置:网站首页>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
边栏推荐
- C language implements memcpy, memset, strcpy, strncpy, StrCmp, strncmp and strlen
- 2022江西光伏展,中國分布式光伏展會,南昌太陽能利用展
- Transfer learning of five categories of pictures based on VGg
- C language loop structure program
- C network related operations
- C byte array (byte []) and string are converted to each other
- 2022 Shanghai safety officer C certificate operation certificate examination question bank and simulation examination
- Go对文件操作
- ROS package NMEA_ navsat_ Driver reads GPS and Beidou Positioning Information Notes
- C# 网络相关操作
猜你喜欢

Jenkspy package installation

Theory and practice of laser slam in dark blue College - Chapter 2 (odometer calibration)

Go的Gin框架学习

Remember using Ali Font Icon Library for the first time

cv_ Solution of mismatch between bridge and opencv

Docker 安装 MySQL

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

开源按键组件Multi_Button的使用,含测试工程

ArcGIS table to excel exceeds the upper limit, conversion failed

re正則錶達式
随机推荐
Vite configure proxy proxy to solve cross domain
Notes on common basic usage of eigen Library
极致体验,揭晓抖音背后的音视频技术
Timestamp to formatted date
ES6 face test questions (reference documents)
Installation du docker redis
Secure credit
Encapsulate a timestamp to date method on string prototype
Docker 安装 MySQL
Qtablewidget usage explanation
I/O多路复用及其相关详解
How to read literature
Auto. JS custom dialog box
Pyppeter crawler
Welcome to the markdown editor
C language implements memcpy, memset, strcpy, strncpy, StrCmp, strncmp and strlen
Climbing watermelon video URL
Halo open source project learning (II): entity classes and data tables
[UDS unified diagnostic service] IV. typical diagnostic service (4) - online programming function unit (0x34-0x38)
.104History