質問編集履歴

1

ソースの追加

2016/01/09 05:40

投稿

Cobalt
Cobalt

スコア10

test CHANGED
File without changes
test CHANGED
@@ -197,3 +197,33 @@
197
197
  開発者コマンド プロンプト for VS2013 を使ってコンパイルしました。
198
198
 
199
199
  手を加えたのは上記のWritePages内です。
200
+
201
+ 書き込みの動作は次の通りです。
202
+
203
+ ```
204
+
205
+ void writestr(char *str) {//配列に対応
206
+
207
+ /* Everything written to the PDF file goes through this function. */
208
+
209
+ /* This means we can keep track of the file position without using */
210
+
211
+ /* ftell on a real (tmp) file. However, PCs write out 2 characters */
212
+
213
+ /* for \n, so we need this ugly loop to keep fpos correct */
214
+
215
+
216
+
217
+ fpos += strlen(str);
218
+
219
+ while (*str) { //文字コードが0になるNULL,終端文字で終了
220
+
221
+ if (*str == '\n') fpos += LF_EXTRA;
222
+
223
+ putchar(*str++);
224
+
225
+ }
226
+
227
+ }
228
+
229
+ ```