Logo CodeXlog
  • Home
  • About
  • Recent Posts
  • 게시글
  • Tags
  • Dark Theme
    Light Theme Dark Theme System Theme
Logo Inverted Logo
  • 게시글
  • Blog-Migration
    • Hugo
    • Jekyll
  • Study
    • Algorithms
      • Algorithms Problem
        • Backjoon
          • Problem.100039
          • Problem.1065
          • Problem.10809
          • Problem.10871
          • Problem.1110
          • Problem.1152
          • Problem.1157
          • Problem.11654
          • Problem.11718
          • Problem.11719
          • Problem.11720
          • Problem.11721
          • Problem.1316
          • Problem.1546
          • Problem.15552
          • Problem.1924
          • Problem.1978
          • Problem.2257
          • Problem.2439
          • Problem.2441
          • Problem.2448
          • Problem.2490
          • Problem.2675
          • Problem.2839
          • Problem.2908
          • Problem.2920
          • Problem.2941
          • Problem.4673
          • Problem.5622
          • Problem.8393
          • Problem.8958
          • Problem.9461
      • Programming Tips
        • C언어 Scanf 의 의미
      • Etc Problem
        • Prob 달팽이 배열
        • 기초 문제
        • 다양한 패턴 출력
        • 큰수 작은수로 정렬후 덧셈
        • 파스칼의 삼각형
    • Computer Science
      • 시스템프로그래밍 FTW 구현
      • 시스템프로그래밍 FTW 구현
    • Programming Language
      • Python
        • Python 기초
      • C언어 스터디
      • 강제 캐스팅에 의한 1byte 단위 접근법
  • Dev
    • DevOps
      • [DevOps] Terraform vs Ansible 뭐가 다르죠?
    • Tips
      • AWS text recognizer
        • AWS project 진행 과정
        • AWS 이미지속 글자 추출
        • Django 따라해보기!!
    • Tips
    • Git Manual
  • OS
    • BSD-Based OS
    • Linux
      • Debain-Based OS
        • Ubuntu & OSX setting
      • RHEL-Based OS
        • CentOS 7
    • Mac OS
      • Mac Autojump 설치및 사용법
    • Window OS
      • Git 설치 및 초기설정
  • Tools
    • GitLab
      • GitLab Upgrade
Hero Image
C언어 Scanf 의 의미

Scanf 에서 공백과 \n의 의미 먼저 IBM에서 제공하는 Scanf의 정의먼저 보겠습니다. 공백 문자로,isspace()함수(줄 바꾸기 문자와 공백과 같은)에서 지정됩니다. 공백 문자로 scanf함수는 공백이 아닌 다음 문자까지 입력의 모든 연속 공백 문자를 읽지만 저장하지 않습니다. format-string의 한 공백 문자는 입력에서 공백 문자의 조합과 일치합니다. 퍼센트 기호 문자(%)를 제외하고, 공백이 아닌 문자입니다. 공백이 아닌 문자로scanf()함수는 일치하는 공백이 아닌 문자를 읽지만 저장하지 않습니다. stdin의 다음 문자가 일치하지 않는 경우,scanf()함수가 종료합니다. 예제 #include <stdio.h> int main(){ int a,b; scanf("%d ",&a); printf("%d\n",a); scanf("%d ",&b); printf("%d\n",b); } $ ./a.out 1 1 2 2 우리가 1을 입력후 엔터를 치면 1이 출력되고 그다음 2를 입력하면 2가 출력 될것이라고 예상할것이다.

  • Study
  • Programming tips
  • C
  • Scanf
2020년 6월 8일 월요일 | 1
바로가기
  • About
  • Recent Posts
  • Tags
Contact me:
  • codex.devlab@gmail.com
  • ehdwn1991
  • Codex

책임 고지: This theme is under MIT license. So, you can use it for non-commercial, commercial, or private uses. You can modify or distribute the theme without requiring any permission from the theme author. However, the theme author does not provide any warranty or takes any liability for any issue with the theme.