質問編集履歴
3
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
Hacking: 美しき策謀 第2版 ―脆弱性攻撃の理論と実際って本で提供さ入れているubuntuでは正常にgccでコンパイルして動作するのに、自分で準備したlubuntuではエラーが出ます。原因を教えてください。両方VBOXでやってます。 あとどうして\nを入れてないのに改行されているのかわかりません。
|
2
|
-
|
2
|
+
```
|
3
3
|
#include <stdio.h>
|
4
4
|
#include <string.h>
|
5
5
|
|
@@ -24,35 +24,6 @@
|
|
24
24
|
printf(pointer); // 1つ目のポインタが指している文字列を表示する
|
25
25
|
^~~~~~
|
26
26
|
pointer.c:14:4: warning: format not a string literal and no format arguments [-Wformat-security]
|
27
|
-
printf(pointer2); //
|
27
|
+
printf(pointer2); //
|
28
|
-
^~~~~~
|
29
|
-
pointer.c:16:4: warning: format not a string literal and no format arguments [-Wformat-security]
|
30
|
-
printf(pointer); // 1つ目のポインタが指している文字列を表示する
|
31
|
-
|
32
|
-
|
28
|
+
コード
|
33
|
-
|
34
|
-
Hello, world
|
35
|
-
|
36
|
-
llo, world
|
37
|
-
|
38
|
-
Hey you guys
|
39
|
-
|
40
|
-
|
29
|
+
```
|
41
|
-
このコードなら正常に動きました
|
42
|
-
#include <stdio.h>
|
43
|
-
#include <string.h>
|
44
|
-
|
45
|
-
int main(void) {
|
46
|
-
char hako[20];
|
47
|
-
char *pointer;
|
48
|
-
char *pointer2;
|
49
|
-
|
50
|
-
strcpy(hako, "hello, world\n");
|
51
|
-
pointer = hako;
|
52
|
-
printf("%s",hako);
|
53
|
-
|
54
|
-
pointer2 = pointer + 2;
|
55
|
-
printf("%s",pointer2);
|
56
|
-
strcpy(pointer2, "y you guys!\n");
|
57
|
-
printf("%s",pointer);
|
58
|
-
}
|
2
追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -35,4 +35,24 @@
|
|
35
35
|
|
36
36
|
llo, world
|
37
37
|
|
38
|
-
Hey you guys
|
38
|
+
Hey you guys
|
39
|
+
|
40
|
+
追記
|
41
|
+
このコードなら正常に動きました
|
42
|
+
#include <stdio.h>
|
43
|
+
#include <string.h>
|
44
|
+
|
45
|
+
int main(void) {
|
46
|
+
char hako[20];
|
47
|
+
char *pointer;
|
48
|
+
char *pointer2;
|
49
|
+
|
50
|
+
strcpy(hako, "hello, world\n");
|
51
|
+
pointer = hako;
|
52
|
+
printf("%s",hako);
|
53
|
+
|
54
|
+
pointer2 = pointer + 2;
|
55
|
+
printf("%s",pointer2);
|
56
|
+
strcpy(pointer2, "y you guys!\n");
|
57
|
+
printf("%s",pointer);
|
58
|
+
}
|
1
タグの追加
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|