Á¤¼ºÈÆ
    fgets.c (±³Àç)
  http://itsys.hansung.ac.kr/cgi-bin/onlineTest/viewCcoding/onlineCcoding.cgi?source=src/chap12/fgets.c



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
 
int main(void)
{
    FILE *fp;
    char str[100];  
    
    fp = fopen("file.txt""w");
 
    if (fp == NULL) {
        fprintf(stderr, "ÆÄÀÏ file.txt¸¦ ¿­ ¼ö ¾ø½À´Ï´Ù.\n");
        exit(0);
    }
    
    do {
        gets_s(str, 100);           // »ç¿ëÀڷκÎÅÍ ÇÑ ÁÙÀ» ¹Þ´Â´Ù.
        fputs(str, fp);     // ÇÑ ÁÙÀ» ÆÄÀÏ¿¡ ¾´´Ù.
    } while (strlen(str) != 0); // »ç¿ëÀÚ°¡ ¾Æ¹«°Íµµ ÀûÁö ¾ÊÀ¸¸é ¹Ýº¹ ·çÇÁ Å»Ãâ
 
    fclose(fp);
    return 0;
}
cs

  µî·ÏÀÏ : 2022-02-23 [01:47] Á¶È¸ : 388 ´Ù¿î : 0   
 
¡â ÀÌÀü±Ûfcopy1.c (±³Àç)
¡ä ´ÙÀ½±Ûfgetc.c (±³Àç)
ÇÁ·Î±×·¡¹Ö¾ð¾î ½Ç½À°Ô½ÃÆÇ
¹øÈ£ ¨Ï Á¦ ¸ñ Á¶È¸ µî·ÏÀÏ
lMini Project (¾îµåº¥Ã³ °ÔÀÓ ¸¸µé±â) Ãß°¡ ±¸Çö // ¡Ú¡Ú¡Ú ±â¸»°úÁ¦ °ÔÀÓ±¸Çö ½Ã Âü°í
l½Ç½À ¸ñÂ÷
261 ¦¦❶ lfseek1.c (±³Àç) 458 02-23
260 ¦¦❶ limagedisp.c (±³Àç) 456 02-23
259 ¦¦❶ lbinary2.c (±³Àç) 473 02-23
258 ¦¦❶ lbinary1.c (±³Àç) 389 02-23
257 ¦¦❶ lscore3.c (±³Àç) 475 02-23
256 ¦¦❶ lfprintf.c (±³Àç) 437 02-23
255 ¦¦❶ lfcopy1.c (±³Àç) 352 02-23
254 ¦¦❶ lfgets.c (±³Àç) 388 02-23
253 ¦¦❶ lfgetc.c (±³Àç) 354 02-23
252 ¦¦❶ lfputs.c (±³Àç) 342 02-23
251 ¦¦❶ lfile_open.c (±³Àç) 416 02-23
250 (11Àå) ±¸Á¶Ã¼ 446 02-23
249 ¦¦❶ Mini Project (µµ¼­°ü °ü¸® ÇÁ·Î±×·¥) 363 05-02
248    ¦¦❷ Mini Project (µµ¼­°ü °ü¸® ÇÁ·Î±×·¥) (¸ð¹ü ´ä¾È) 213 05-02
247 ¦¦❶ ¨ÕÃß°¡ µµÀü ¹®Á¦ 1 224 05-30
246    ¦¦❷ Ãß°¡ µµÀü ¹®Á¦ 1 (±¸Çö Áß ÀÔ·ÂÀÌ ³Ñ¾î°¥ ¶§ ÇØ°á ¹æ¹ý) 149 05-31
245    ¦¦❷ Ãß°¡ µµÀü ¹®Á¦ 1 (¸ð¹ü ´ä¾È) 189 05-30
244 ¦¦❶ ltypedef.c (±³Àç) 553 02-23
243 ¦¦❶ lenum1.c (±³Àç) 568 02-23
242 ¦¦❶ lunion.c (±³Àç) 628 02-23

[1][2][3][4][5][6][7][8][9][10]-[Next][15]