문자(char) '1' 에서 문자(char) '0'을 빼면
숫자 1이 남겠죠?
다음과 같이 코딩하면 될것입니다.
char *p=str.c_str();
for(int idx=0; idx < str.Length() ; idx++ )
{
nstr[idx]=p[idx] - '0' ;
}
그럼..
최성웅 님이 쓰신 글 :
: AnsiString str = "12345678";
: int nstr[];
:
: 여기에서 str의 문자열을 int 배열에 대입하여 숫자열로 변환하는 방법을 알고 싶습니다 ㅜㅜ
: int nstr[0] = 1
: int nstr[1] = 2
: int nstr[2] = 3
: int nstr[3] = 4
: int nstr[4] = 5
: int nstr[5] = 6
: ......
:
: 이런식으로요..
:
: 어떤 방법이 있을까요 ?
: 고수분들의 도움을 기다리고 있습니다 ㅜㅜ
|