?,?:,??

轉載https://www.baidu.com/link?url=WPkxkMNcNjqjLF_g7s89B3OCO7HjLemXaasW9Kr621jUA3PlEkim3mXwbIARW4Vl5rHmgjzaGDsUXs0hVDKyTK&wd=&eqid=d398b84100000679000000065b5587a3

1. 可空类型修饰符(?):
引用类型可以使用空引用表示一个不存在的值而值类型通常不能表示为空。
例如:string str=null; 是正确的int i=null; 编译器就会报错。
为了使值类型也可为空就可以使用可空类型即用可空类型修饰符"?"来表示表现形式为"T?"
例如:int? 表示可空的整形DateTime? 表示可为空的时间。
T? 其实是System.Nullable(泛型结构)的缩写形式也就意味着当你用到T?时编译器编译 时会把T?编译成System.Nullable的形式。
例如:int?,编译后便是System.Nullable的形式。

2. 三元(运算符)表达式(?:):
例如:x?y:z 表示如果表达式x为true则返回y;如果x为false则返回z是省略if{}else{}的简单形式。

3. 空合并运算符(??):
用于定义可空类型和引用类型的默认值。如果此运算符的左操作数不为null则此运算符将返回左操作数否则返回右操作数。
例如:a??b 当a为null时则返回ba不为null时则返回a本身。
空合并运算符为右结合运算符即操作时从右向左进行组合的。如“a??b??c”的形式按“a??(b??c)”计算。
QGeoTileProviderOsm: Tileserver disabled at QUrl("http://maps-redirect.qt.io/osm/5.8/satellite") QGeoTileFetcherOsm: all providers resolved QNetworkReplyImplPrivate::error: Internal problem, this method must only be called once. QGeoTileRequestManager: Failed to fetch tile (6462,3363,13) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3228,1678,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (6465,3363,13) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3235,1678,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3229,1680,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (1615,840,11) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3229,1683,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (1616,841,11) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3234,1682,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (6463,3361,13) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (6464,3360,13) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (1616,840,11) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3234,1679,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (6462,3362,13) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3230,1678,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (6464,3361,13) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (1615,841,11) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3234,1683,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3234,1680,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3233,1678,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3229,1681,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (6463,3362,13) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3231,1678,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3235,1679,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3228,1679,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (6465,3360,13) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (6462,3360,13) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3235,1682,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3228,1682,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3232,1683,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3230,1683,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3234,1681,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (6464,3362,13) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3229,1678,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (6463,3363,13) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (6465,3361,13) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (6462,3361,13) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3235,1683,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3235,1680,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3228,1683,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3228,1680,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3234,1678,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (6464,3363,13) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (1616,839,11) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3229,1679,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (6463,3360,13) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3229,1682,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3233,1683,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (1615,839,11) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3231,1683,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3235,1681,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (6465,3362,13) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3228,1681,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3232,1678,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3232,1680,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3231,1681,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3230,1682,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3231,1680,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3233,1681,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3232,1682,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3233,1680,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3231,1682,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3233,1682,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3230,1679,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3232,1679,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3231,1679,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3230,1681,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3233,1679,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3230,1680,12) 5 times, giving up. Last error message was: '??????' QGeoTileRequestManager: Failed to fetch tile (3232,1681,12) 5 times, giving up. Last error message was: '??????'
最新发布
09-23
module dzq4( input clk2, // 系统时钟(50MHz) input [17:0] Key, // 18个按键输入(高电平有效) output reg [3:0] LED // 4个LED灯输出 ); // 音调编码部分 - 高电平有效 reg [7:0] tone; // 存储音调值 always @(*) begin casez(Key) // 所有音符周期 < 100us (频率 > 10kHz) // 完整18位模式,使用?表示不关心的位 18'b???????????????1??: tone = 8'd249; // 按键0 18'b??????????????10??: tone = 8'd231; // 按键1 18'b?????????????100??: tone = 8'd214; // 按键2 18'b????????????1000??: tone = 8'd198; // 按键3 18'b???????????10000??: tone = 8'd183; // 按键4 18'b??????????100000??: tone = 8'd169; // 按键5 18'b?????????1000000??: tone = 8'd156; // 按键6 18'b????????10000000??: tone = 8'd144; // 按键7 18'b???????100000000??: tone = 8'd133; // 按键8 18'b??????1000000000??: tone = 8'd123; // 按键9 18'b?????10000000000??: tone = 8'd114; // 按键10 18'b????100000000000??: tone = 8'd105; // 按键11 18'b???1000000000000??: tone = 8'd97; // 按键12 18'b??10000000000000??: tone = 8'd90; // 按键13 18'b?100000000000000??: tone = 8'd83; // 按键14 18'b1000000000000000??: tone = 8'd77; // 按键15 18'b000000000000000?1?: tone = 8'd71; // 按键16 18'b0000000000000000?1: tone = 8'd66; // 按键17 default: tone = 8'd0; // 无按键 endcase end // 分频器部分 reg [15:0] counter = 0; // 主计数器 wire period_end = (counter >= {8'd0, tone}); // 周期结束标志 always @(posedge clk2) begin if(tone == 0) begin counter <= 0; LED <= 4'b0000; // 所有LED关闭 end else begin if(period_end) begin counter <= 0; LED <= LED + 1'b1; // 循环点亮下一个LED end else begin counter <= counter + 1; end end end endmodule以这个代码为原理的电子琴,告诉我在EP4CE115F29C7详细的分配引脚方案
06-06
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值