All pastes #1396874 Raw Edit

pareInt c

public cpp v1 · immutable
#1396874 ·published 2009-04-19 23:36 UTC
rendered paste body
unsigned int parseInt(char* ptr) {	const char *s = ptr;	uint r = 0;	uint p = 0;	while (s[p]) {		char c = s[p];		if ((c < '0') || (c > '9')) {			return 0;		}		r = r * 10 + (c - '0');		++p;	}	return r;};