[Cexpert-001] How to implement atoi with least codes using C language?
来源:互联网 发布:徐静蕾字体 mac 编辑:程序博客网 时间:2024/05/17 22:42
It's soooo easy, I think.
#include <stdio.h>int atoi(unsigned char *str){ int num = 0; while (*str >= '0' && *str <= '9') num = num * 10 + *str++ - '0'; return num;}int main(void){ printf("%d\n", atoi("12345")); return 0;}
So easy, right?
-
Poechant
-
- [Cexpert-001] How to implement atoi with least codes using C language?
- How to Implement Add/Edit/Delete/View with PHP using Angular JS (Part-1)
- How to Implement Add/Edit/Delete/View with PHP using Angular JS (Part-2)
- How to implement COMET with PHP
- 转:How to implement COMET with PHP
- How to implement COMET with PHP
- How to implement DynamicMBean with custom annotation
- [Cexpert-004] How to output strings to stdout/stderr directly?
- How to implement the similar mechanism with Java final in c++?
- How to implement Polymorphism in C
- How to Deal with Messy Codes in Essbase
- How to implement globalization in C# - 1. using PropertyGrid
- how to implement it using Error.pm(转)
- How To Implement Search Bar in iOS 7 Using Storyboard
- How to implement embedded Mqtt Client using W5500 IC
- How to implement Quality Of Service using Floodlight
- How To Study C Programming Language
- C Language Study - how to use '#'
- 与SQL相关的动态性能视图
- C++设计模式之一 工厂模式(简单工厂、工厂和抽象工厂)
- 浏览器专属 CSS Hack:区分 Firefox / Opera / Safari / Internet Explorer
- 失眠了
- 三场排名赛小结(2012.4.4)
- [Cexpert-001] How to implement atoi with least codes using C language?
- 嵌入式实时操作系统的可裁剪性及其实现
- 路由器密码大全及相关操作
- 学习
- NYOJ 2 括号配对问题(栈)
- hdoj 3586 Information Disturbing(二分答案+树dp判断)
- 让IIS支持PHP
- java project整合spring和hibernate
- VC中利用CArchive类存取数据