当前位置:网站首页>Variable declarations following if statements
Variable declarations following if statements
2022-07-03 02:52:00 【French red wine sweet】
problem :
An issue came up on another forum and I knew how to fix it, but it revealed a feature of the compiler peculiar to me. There is a problem in another forum , I know how to solve it , But it reveals my unique compiler features .The person was getting the error "Embedded statement cannot be a declaration or labeled statement" because they had a declaration of a variable following an if statement with no brackets. This person received an error message “ Embedded statements cannot be declarative or tagged statements ”, Because they're if There is an parenthesized variable declaration after the statement .That was not their intent, but they had commented out the line of code immediately following the if statement, which made the variable declaration the de facto line of code to execute. This is not their intention , But they are if The code line is commented out immediately after the statement , This makes the variable declaration the line of code to actually execute .Anyway, that's the background, which brings me to this. in any case , This is the background , This reminds me of this .
The following code is illegal The following code is illegal
if (true) int i = 7;However, if you wrap that in brackets, it's all legal. however , If you put it in square brackets , Is completely legal .
if (true){ int i = 7;}Neither piece of code is useful. These two pieces of code are useless .Yet the second one is OK. The second one is ok .What specifically is the explanation for this behavior? What is the specific explanation for this behavior ?
Solution :
Reference resources : https://stackoom.com/en/question/ATTZ边栏推荐
- I2C 子系统(四):I2C debug
- Today, it's time to copy the bottom!
- Counter统计数量后,如何返回有序的key
- SQL Server Query spécifie la structure de la table
- Add MDF database file to SQL Server database, and the error is reported
- [Hcia]No.15 Vlan间通信
- Practice of traffic recording and playback in vivo
- [fluent] future asynchronous programming (introduction | then method | exception capture | async, await keywords | whencomplete method | timeout method)
- Kubernetes cluster log and efk architecture log scheme
- [principles of multithreading and high concurrency: 1_cpu multi-level cache model]
猜你喜欢

Deep learning: multi-layer perceptron and XOR problem (pytoch Implementation)

Thunderbolt Chrome extension caused the data returned by the server JS parsing page data exception

Deep reinforcement learning for intelligent transportation systems: a survey paper reading notes

Baidu map - surrounding search

Kubernetes cluster log and efk architecture log scheme

where 1=1 是什么意思

超好用的日志库 logzero

Kubernetes family container housekeeper pod online Q & A?

Add automatic model generation function to hade

HTB-Devel
随机推荐
[C语言]给账号密码进行MD5加密
超好用的日志库 logzero
Practice of traffic recording and playback in vivo
Three. JS local environment setup
内存泄漏工具VLD安装及使用
Choose it when you decide
ASP. Net core 6 framework unveiling example demonstration [02]: application development based on routing, MVC and grpc
JS finds all the parent nodes or child nodes under a node according to the tree structure
sql server 查询指定表的表结构
你真的懂继电器吗?
Introduction to cron expression
Add some hard dishes to the interview: how to improve throughput and timeliness in delayed task scenarios!
I2C 子系统(三):I2C Driver
I2C 子系統(四):I2C debug
基于can总线的A2L文件解析(2)
The left value and the right finger explain better
[Fuhan 6630 encodes and stores videos, and uses RTSP server and timestamp synchronization to realize VLC viewing videos]
Strategy application of Dameng database
Gbase 8C function / stored procedure parameters (I)
[translation] flux is safe. Gain more confidence through fuzzy processing