학습 내용 : 한 개의 문자를 printf() 함수를 사용하지 않고 출력하는 원리를 이해합니다.
소스 코드 :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#include <stdio.h>
#include <conio.h>
#pragma warning(disable:4996)
int print(char *string);
void main()
{
print("This is a putch function");
}
int print(char *string)
{
int len = 0;
while (*string != (char)NULL)
{
putch(*string);
string++;
len++;
}
// 현재 출력되고 있는 줄을 다음 줄의 첫 번째로 이동
putch('\r');
putch('\n');
return len;
}
|
실행 화면 :

'프로그래밍 > C언어 300제' 카테고리의 다른 글
중급 54. 정수값 출력하기 (printf) (0) | 2020.02.17 |
---|---|
중급 53. 정수값 입력받기 (scanf) (0) | 2020.02.17 |
중급 51. 문자 입력받기 (getch) (0) | 2020.02.17 |
초급 50. 매크로 이해하기 (0) | 2020.02.16 |
초급 49. #include문 이해하기 (0) | 2020.02.16 |
트랙백 , 댓글 가 달렸습니다.