Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- String
- server
- 종만북
- dfs
- Algorithm
- web
- 정수론
- BFS
- Python
- 백준
- 따라하며 배우는 C언어
- BASIC
- greedy
- 생활코딩
- Algospot
- sorting
- DP
- Cleancode
- programmers
- BOJ
- C
- php
- C언어
- 따라하면서 배우는 C언어
- 따배씨
- JavaScript
- 인프런
- graph
- Math
- udemy
Archives
- Today
- Total
몽상실현개발주의
[따배씨] 11.9 문자함수 ctype.h 를 문자열에 사용하기 본문
따배씨 - 따라하며 배우는 C언어
11강 문자열 함수들
11.9 문자함수 ctype.h 를 문자열에 사용하기
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#define NUM_LIMIT 1024
void toUpper(char*);
int PunctCount(const char*);
int main(){
char line[NUM_LIMIT];
char* new_line = NULL;
fgets(line, NUM_LIMIT, stdin); // fine first newLine
new_line = strchr(line, '\n');
if (new_line)
*new_line = '\0'; // '\n' 을 '\0'로 교체
toUpper(line);
puts(line);
printf("%d\n", PunctCount(line));
return 0;
}
void toUpper(char* str){
while (*str){
*str = toupper(*str);
// if (islower(*str))
// *str = toupper(*str);
str++;
}
}
int PunctCount(const char* str){
int ct = 0;
while(*str){
if (ispuntc(*str))
ct++;
str++;
}
return ct;
}
이 글의 모든 사진과 내용의 출처는 홍정모 교수님께 있음을 알려드립니다.
http://blog.naver.com/atelierjpro
실리콘 밸리의 프로그래머 : 네이버 블로그
안녕하세요! 홍정모 블로그에 오신 것을 환영합니다. 주로 프로그래밍 관련 메모 용도로 사용합니다. 강의 수강하시는 분들은 홍정모 연구소 카페로 오세요.
blog.naver.com
http://www.inflearn.com/course/following-c
홍정모의 따라하며 배우는 C언어 - 인프런 | 강의
'따배씨++'의 성원에 힘입어 새롭게 개발된 C 언어로 시작하는 프로그래밍 입문 강의입니다. '따배씨'와 함께 프로그래밍 인생을 업그레이드 해보세요., 따라하며 배우는 C언어 '따배씨++'의 성원
www.inflearn.com
'Language > C' 카테고리의 다른 글
[따배씨] 11.11 문자열을 숫자로 바꾸는 방법들 (0) | 2021.06.10 |
---|---|
[따배씨] 11.10 명령줄 인수 (0) | 2021.06.10 |
[따배씨] 11.8 문자열의 포인터를 정렬하기 (0) | 2021.06.10 |
[따배씨] 11.7 선택 정렬 문제 풀이 (0) | 2021.06.10 |
[따배씨] 11.6 다양한 문자열 함수들 (0) | 2021.06.09 |
Comments