回答編集履歴
1
追記
test
CHANGED
@@ -1,3 +1,33 @@
|
|
1
1
|
× str=" string";
|
2
2
|
|
3
3
|
○ strcpy(str, " string");
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
[追記]
|
8
|
+
|
9
|
+
```C
|
10
|
+
|
11
|
+
#include <stdio.h>
|
12
|
+
|
13
|
+
#include <stdlib.h>
|
14
|
+
|
15
|
+
#define aaaaaaaa 20
|
16
|
+
|
17
|
+
#define bbbbbbb 15
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
int main(){
|
22
|
+
|
23
|
+
char* str=malloc(sizeof(char)*100);
|
24
|
+
|
25
|
+
sprintf(str, "%02d%02dstring", aaaaaaaa,bbbbbbb); // これでえぇんちゃう?
|
26
|
+
|
27
|
+
printf("%s",str);
|
28
|
+
|
29
|
+
free(str);
|
30
|
+
|
31
|
+
}
|
32
|
+
|
33
|
+
```
|