This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| long unsigned int strToInt(char * str) | |
| { | |
| long unsigned int result = 0; | |
| while(*str) | |
| { | |
| result *= 10; | |
| result += *str - '0'; | |
| str++; | |
| } | |
| return result; |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.IO; | |
| namespace remraw | |
| { | |
| class Program | |
| { |
| void itob(int n, char s[], int b) | |
| { | |
| int i = 0, temp; | |
| n = n > 0 ? n : -n; | |
| do { | |
| temp = n % b; | |
| if(temp < 10) | |
| s[i++] = '0' + temp; |