C 언어: printf 함수

C언어: 출력


/// 헤더파일

#include <stdio.h>

/// 함수원형

int printf (const char * format, ...);

/// 인자

const char * format, ...: 문자열(과 문자열안의 서식 지정자에 관련된 값)

/// 반환값

성공시 반환값(return value): 출력 문자열의 문자 수(Byte 수)
오류시 반환값(return value): 음수

/// 참고파일

헤더파일: stdio.h(연결)
헤더파일: stdio.h(연결)
소스파일: printf.c(연결)

reference
https://man7.org/linux/man-pages/man1/printf.1.html

/// 예제

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <stdio.h>
 
int main(void) {
    puts("------ Move Contens to a memory for stdout ------");
    puts("------ In case of line buffered or fully buffered ------");
 
    printf("return value is %d \n"printf("1. %d "777));
    printf("return value is %d \n"printf("2. %f "0.5));
    printf("return value is %d \n"printf("3. %s ""'String'"));
    printf("return value is %d \n"printf("4. %s ""한글"));
    puts("...");
 
    puts("----- and You can see contents direclty ------");
 
    return 0;
}
cs

* 실행환경: Linux(5.7.6-x86_64-linode136)
* 컴파일러: gcc (Ubuntu 6.5.0-2ubuntu1~14.04.1) 6.5.0 20181026


- 당신을 응원합니다. -

댓글

이 블로그의 인기 게시물

파이썬[Python]: 내장함수 - from_bytes 메서드

파이썬[Python]: 내장함수 - __len__ 메서드

파이썬[Python]: kivy - 한글 사용

파이썬[Python]: 내장함수 - bit_length 메서드

C 언어: sin 함수, cos 함수, tan 함수