Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 | 31 |
Tags
- 빅데이터
- 모의 주식
- 개발자
- 자바
- 주가예측
- C++
- 개발
- 코스닥
- 풀스택프레임워크
- 자바정리
- 코딩
- 프로그래머스
- frontend
- 사물인터넷
- java
- SNS
- 자바독학
- 프로그래밍
- Reflex
- backend
- 코테
- 코딩테스트
- java정리
- Python
- 백준
- 코딩독학
- Project
- 이웃한 칸
- 프로그램
- 개인프로젝트
Archives
- Today
- Total
Creative Code
atoi.c(문자열을 숫자로 출력) 본문
#include <stdio.h>
#include <string.h>
#include <math.h>
int my_atoi(char *str) {
int num = 0;
int len = strlen(str);
for (int i = len-1; i>=0; i--){
num += (str[len-1-i] - '0')*(pow(10,i));
}
return num;
}
int main(void){
int i = my_atoi("100");
printf("i : %d\n",i);
return 0;
}
'C Programming' 카테고리의 다른 글
stringArray.c(문자열배열-이중포인터) (0) | 2023.08.08 |
---|---|
hello7.c(문자열 배열-포인터) (0) | 2023.08.08 |
main.c(문자열 라이브러리) (0) | 2023.08.07 |
main.c(구조체 포인터,파일 입출력 사용 성적순 정렬) (0) | 2023.08.07 |
score.dat(점수 데이터) (0) | 2023.08.07 |