본문 바로가기

배우는 여자/코딩

c언어 입출력 기본

#include <stdio.h> // printf 사용

#include <stdlib.h>

#include <string.h>

printf("%d", int 변수); // int 변수 출력

printf("%s", str); // 문자열 변수 출력

fopen("___.txt", "r" or "w") // "r" 읽기 , "w" 쓰기

("%[^\n]s", str) // 문자열 \n 까지 읽어들이기