teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

変更

2015/11/02 20:38

投稿

cheeeeeeese
cheeeeeeese

スコア179

title CHANGED
@@ -1,1 +1,1 @@
1
- Swift Increment and Decrement Operators
1
+ Swift Incrementで困っています。
body CHANGED
@@ -1,14 +1,27 @@
1
1
  皆様、質問がございます。よろしくお願い申し上げます。
2
2
 
3
+ 質問
3
4
 
4
- Increment and Decrement Operators
5
+ 下記のa++、++aが何の処理を行っているのかが理解できません。
5
6
 
6
- 下記のa++がわからない。。
7
+ ```
8
+ If the operator appears before the variable, it increments the variable before returning its value.
7
9
 
10
+ もしオペレータが変数の前に表示される場合は、オペレーターが値を戻す前に、その変数をインクリメント(加算)します。
11
+
12
+ If the operator appears after the variable, it increments the variable after returning its value.
13
+
14
+ もしオペレータが変数の後に表示される場合は、オペレーターが値を戻した後、その変数をインクリメント(加算)します。
8
15
  ```
16
+
17
+ と説明がありましたが、理解には至りませんでした。
18
+
19
+ ```
9
20
  Which choice is the output value of the following code:
10
21
  var a = 0
11
22
  let b = ++a
12
23
  let c = a++
13
24
  print("\(a) \(b) \(c)") //211
14
- ```
25
+ ```
26
+
27
+ よろしくお願い申し上げます。