Comments (3)
你好,按我的理解,括号的优先级高于 + 运算符,所以会优先进行括号内部的 ++ 运算,a 作为一个变量怎么可能有两个值?必然是同时提升,所以最后应该是 7+7 = 14。
但是我把代码复制到 Xcode 跑了一下,结果却是13 ,这一点我也没有弄清楚,如果你弄明白,希望不吝指教。
from ios-interviewquestion-collection.
编译器的问题,xcode使用的是clang.你说的情况在gcc的情况下的正确的.
详情可以看这个链接:
https://www.zhihu.com/question/39590451
from ios-interviewquestion-collection.
非常感谢!!!
from ios-interviewquestion-collection.
Related Issues (20)
- what ?很多都是重复的? HOT 3
- 太多的冗余文件希望删掉吧 HOT 1
- <说一下控制器 View 的生命周期,一旦收到内存警告会如何处理> HOT 1
- 快速排序的Partition最后复位 HOT 1
- 字节跳动(深圳)急招 iOS 工程师 HOT 1
- /内存管理/17.第十七题.md 没图片
- int a=5,b; b=(++a)+(++a); 我用xcode调试的结果为13
- 内存管理的第一题 NONPOINTER_ISA里漏了一个很重要的extra_rc的变量
- 第一个逻辑运算题答案 HOT 2
- Animation第五题 HOT 2
- 【抖音】抖音杭州诚招iOS开发工程师-北上深杭
- ARC 的 retainCount 怎么存储的? HOT 2
- Runtime 第七题:Category 和 Extension 有什么区别 HOT 2
- [计算题][第二题]交换两个变量 不太对 HOT 1
- 只有题目没有答案的么? HOT 3
- typo 24.其他问题/15.第十五题 HOT 1
- 计算题/1.第一题.md 文件一片空白 HOT 3
- 这里还有一些问题,推荐一起整理。 HOT 1
- 能否提供和Swift有关的面试题? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ios-interviewquestion-collection.