Define an algorithm that converts a string to an integer without using a built in method like int()
Utilisateur anonyme
in Java: String f = "2456"; int length = f.length(); double result = 0; for (int i = 0; i < length; i++) { char c = f.charAt(i); int x = c - 48; double exp = Math.pow(10,length-1-i); result = result + (exp*x); } int myInt = (int)result;