#include <stdio.h>
#include <math.h>
#include <string.h>

int main(void){

    char str[30];
    int ch;
    
	FILE * fp=fopen("simple.txt", "rt");
    if(fp==NULL)
    {
        puts("파일오픈 실패!");
        return -1;
    }

    ch=fgetc(fp);
    printf("%c \n", ch);
    ch=fgetc(fp);
    printf("%c \n", ch);

    fgets(str, sizeof(str), fp);
    printf("%s", str);
    fgets(str, sizeof(str), fp);
    printf("%s", str);
    
    fclose(fp);
    return 0;
	
}

웹사이트에 삽입

이 프로젝트를 웹사이트에 삽입하려면 다음 코드를 복사하여 웹사이트의 HTML에 붙여넣으세요.