메뉴 건너뛰기

Programing

C언어 게시판

문자열 입출력

관리자2 2018.12.19 19:11 조회 수 : 163

#include <stdio.h>

 

int main() {

  

  char a[1001];

scanf("%s",a);

printf("%s",a);

  

  return 0;

}

문자열은 Char형으로 선언하여 사용하고 형식지정자는 %s이다.

char 변수이름[글자 수+1(1추가이유는 NULL문자형)];으로 사용한다.

위로