반응형
java to int
문자열 정수를 int 형 정수로 변경하는 atoi 함수를 자바로 구현
C언어에서 제공하는 atoi 메서드를 자바로 구현해보자. 1234567891011121314151617181920212223242526public class Main { public static void main(String args[]) { atoi("20"); } public static int atoi(String str) { int radix = 10; byte[] temp = str.getBytes(); int result = 0; for(int i=0;i
반응형