質問編集履歴

1

2018/03/31 07:07

投稿

matamatane
matamatane

スコア8

test CHANGED
File without changes
test CHANGED
@@ -6,20 +6,26 @@
6
6
 
7
7
  イメージ例:
8
8
 
9
- extern int (*open_ptr)(const char* filename, int amode, ...);
9
+ extern int (*printf_ptr)(const char* format, ...);
10
10
 
11
- extern int open_stub(const char* filename, int amode, ...);
11
+ extern int printf_stub(const char* format, ...);
12
12
 
13
13
 
14
14
 
15
- int open_stub(const char* filename, int amode, ...){return -1; }
15
+ int printf_stub(const char* format, ...){return -1; }
16
16
 
17
17
 
18
18
 
19
19
 
20
20
 
21
- int (*open_ptr)(const char* filename, int amode, ...) = open;
21
+ int (*printf_ptr)(const char* format, ...) = printf;
22
22
 
23
23
 
24
24
 
25
- open_ptr = open_stub;
25
+ printf_ptr = printf_stub;
26
+
27
+
28
+
29
+ 追記:当初はopen関数で例を記載していましたが、open関数は引数が2つか3つと決まっているため、可変長引数とは呼ばなさそうですね。。
30
+
31
+ printf関数の例に修正しました。失礼しました。