// Program to convert strings to numbers using no inbuilt functions.
// Date 10:16 24/10/2016
// By Ben a.k.a DreamVB

#include <iostream>

using namespace std;
using std::cout;
using std::endl;

int StrToInt(char *src){
	int value = 0;
	//While we have digits
	while (isdigit(*src)){
		//Build the number
		value = value * 10 + *src - '0';
		//Move to next char
		src++;
	}

	return value;
}

int main(int argc, char *argv[]){

	char *s0 = "20";
	char *s1 = "60";
	//Display output.
	cout << "20+60 is  : " << StrToInt(s0) + StrToInt(s1) << endl;
	cout << "1024*2 is : " << StrToInt("1024") * 2 << endl;
	system("pause");
	return 0;
}