回答編集履歴
3
BOOL型の説明補足
test
CHANGED
@@ -46,4 +46,4 @@
|
|
46
46
|
|
47
47
|
```
|
48
48
|
|
49
|
-
と記述することを[おすすめ](http://www.aerith.net/cpp/typical_bug-j.html#BOOL)します。BOOLではなく、[小文字のbool](http://www7b.biglobe.ne.jp/~robe/cpphtml/html01/cpp01074.html)を使った場合はその限りではありませんが...
|
49
|
+
と、==や!=比較せず、そのまま条件判定結果として利用するようにコードを記述することを[おすすめ](http://www.aerith.net/cpp/typical_bug-j.html#BOOL)します。BOOLではなく、[小文字のbool](http://www7b.biglobe.ne.jp/~robe/cpphtml/html01/cpp01074.html)を使った場合、あるいは他の言語で記述する場合はその限りではありませんが...
|
2
修正
test
CHANGED
@@ -18,7 +18,7 @@
|
|
18
18
|
|
19
19
|
```C++
|
20
20
|
|
21
|
-
if(Block[X][Y].L =
|
21
|
+
if(Block[X][Y].L != FALSE){
|
22
22
|
|
23
23
|
```
|
24
24
|
|
1
BOOL型補足
test
CHANGED
@@ -23,3 +23,27 @@
|
|
23
23
|
```
|
24
24
|
|
25
25
|
と書いてみた場合はどうでしょうか?
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
ちなみに、BOOL型のif文判定は
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
```C++
|
34
|
+
|
35
|
+
BOOL booleanState;
|
36
|
+
|
37
|
+
...
|
38
|
+
|
39
|
+
...
|
40
|
+
|
41
|
+
if(booleanState){...} // (真の場合)
|
42
|
+
|
43
|
+
//または
|
44
|
+
|
45
|
+
if(!booleanState){...} // (偽の場合)
|
46
|
+
|
47
|
+
```
|
48
|
+
|
49
|
+
と記述することを[おすすめ](http://www.aerith.net/cpp/typical_bug-j.html#BOOL)します。BOOLではなく、[小文字のbool](http://www7b.biglobe.ne.jp/~robe/cpphtml/html01/cpp01074.html)を使った場合はその限りではありませんが...
|